home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 June: Technology Seed / June 98 ADC Seed.toast / Mac OS 8.5a8 Pseudo SDK / interfaces-and-libraries / AIncludes / Controls.a < prev    next >
Encoding:
Text File  |  1998-06-19  |  92.1 KB  |  2,356 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Controls.a
  3. ;
  4. ;    Contains:    Control Manager interfaces
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  19. __CONTROLS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  28.     include 'Menus.a'
  29.     ENDIF
  30.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  31.     include 'TextEdit.a'
  32.     ENDIF
  33.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  34.     include 'Drag.a'
  35.     ENDIF
  36.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  37.     include 'Icons.a'
  38.     ENDIF
  39.  
  40.  
  41. _ControlDispatch                EQU        $AA73
  42.  
  43. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  44. ;     • Gestalt                                                                                            
  45. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  46.  
  47. gestaltControlMgrAttr            EQU        'cntl'
  48. gestaltControlMgrPresent        EQU        $00000001
  49. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  50. ;     • Resource Types                                                                                    
  51. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  52.  
  53. kControlDefProcType                EQU        'CDEF'
  54. kControlTemplateResourceType    EQU        'CNTL'
  55. kControlColorTableResourceType    EQU        'cctb'
  56. kControlDefProcResourceType        EQU        'CDEF'
  57. kControlTabListResType            EQU        'tab#'                ; used for tab control (Appearance 1.0 and later)
  58. kControlListDescResType            EQU        'ldes'                ; used for list box control (Appearance 1.0 and later)
  59. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  60. ;     • Format of a ‘CNTL’ resource                                                                        
  61. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  62. ControlTemplate            RECORD 0
  63. controlRect                 ds        Rect            ; offset: $0 (0)
  64. controlValue             ds.w    1                ; offset: $8 (8)
  65. controlVisible             ds.b    1                ; offset: $A (10)
  66. fill                     ds.b    1                ; offset: $B (11)
  67. controlMaximum             ds.w    1                ; offset: $C (12)
  68. controlMinimum             ds.w    1                ; offset: $E (14)
  69. controlDefProcID         ds.w    1                ; offset: $10 (16)
  70. controlReference         ds.l    1                ; offset: $12 (18)
  71. controlTitle             ds        Str255            ; offset: $16 (22)
  72. sizeof                     EQU *                    ; size:   $116 (278)
  73.                         ENDR
  74. ; typedef struct ControlTemplate *        ControlTemplatePtr
  75.  
  76. ; typedef ControlTemplatePtr *            ControlTemplateHandle
  77.  
  78.  
  79.  
  80.     IF ¬ TARGET_OS_MAC THEN
  81.  
  82. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  83. ;   • NON-MAC COMPATIBILITY CODES (QuickTime 3.0)
  84. ;  —————————————————————————————————————————————————————————————————————————————————————————————————————————
  85.  
  86.  
  87. ; typedef UInt32                         ControlNotification
  88.  
  89.  
  90. controlNotifyNothing            EQU        'nada'                ; No (null) notification
  91. controlNotifyClick                EQU        'clik'                ; Control was clicked
  92. controlNotifyFocus                EQU        'focu'                ; Control got keyboard focus
  93. controlNotifyKey                EQU        'key '                ; Control got a keypress
  94. ; typedef UInt32                         ControlCapabilities
  95.  
  96.  
  97. kControlCanAutoInvalidate        EQU        $00000001            ; Control component automatically invalidates areas left behind after hide/move operation.
  98. ;  procID's for our added "controls"
  99.  
  100. staticTextProc                    EQU        256                    ; static text
  101. editTextProc                    EQU        272                    ; editable text
  102. iconProc                        EQU        288                    ; icon
  103. userItemProc                    EQU        304                    ; user drawn item
  104. pictItemProc                    EQU        320                    ; pict
  105.     ENDIF
  106. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  107. ;     • ControlHandle                                                                                        
  108. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  109.  
  110.  
  111. ; typedef ControlRecord *                ControlPtr
  112.  
  113. ; typedef ControlPtr *                    ControlHandle
  114.  
  115. ;  ControlRef is obsolete. Use ControlHandle. 
  116. ; typedef ControlHandle                 ControlRef
  117.  
  118. ; typedef SInt16                         ControlPartCode
  119.  
  120. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  121. ;  • Control ActionProcPtr                                                                                
  122. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  123. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  124. ;     • ControlRecord                                                                                        
  125. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  126. ControlRecord            RECORD 0
  127. nextControl                 ds.l    1                ; offset: $0 (0)
  128. contrlOwner                 ds.l    1                ; offset: $4 (4)
  129. contrlRect                 ds        Rect            ; offset: $8 (8)
  130. contrlVis                 ds.b    1                ; offset: $10 (16)
  131. contrlHilite             ds.b    1                ; offset: $11 (17)
  132. contrlValue                 ds.w    1                ; offset: $12 (18)
  133. contrlMin                 ds.w    1                ; offset: $14 (20)
  134. contrlMax                 ds.w    1                ; offset: $16 (22)
  135. contrlDefProc             ds.l    1                ; offset: $18 (24)
  136. contrlData                 ds.l    1                ; offset: $1C (28)
  137. contrlAction             ds.l    1                ; offset: $20 (32)
  138. contrlRfCon                 ds.l    1                ; offset: $24 (36)
  139. contrlTitle                 ds        Str255            ; offset: $28 (40)
  140. sizeof                     EQU *                    ; size:   $128 (296)
  141.                         ENDR
  142. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  143. ;  • Control ActionProcPtr : Epilogue                                                                    
  144. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  145. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  146. ;     • Control Color Table                                                                                
  147. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  148.  
  149. cFrameColor                        EQU        0
  150. cBodyColor                        EQU        1
  151. cTextColor                        EQU        2
  152. cThumbColor                        EQU        3
  153. kNumberCtlCTabEntries            EQU        4
  154. CtlCTab                    RECORD 0
  155. ccSeed                     ds.l    1                ; offset: $0 (0)
  156. ccRider                     ds.w    1                ; offset: $4 (4)
  157. ctSize                     ds.w    1                ; offset: $6 (6)
  158. ctTable                     ds.b    4 * ColorSpec.sizeof ; offset: $8 (8)
  159. sizeof                     EQU *                    ; size:   $28 (40)
  160.                         ENDR
  161. ; typedef struct CtlCTab *                CCTabPtr
  162.  
  163. ; typedef CCTabPtr *                    CCTabHandle
  164.  
  165. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  166. ;     • Auxiliary Control Record                                                                            
  167. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  168. AuxCtlRec                RECORD 0
  169. acNext                     ds.l    1                ; offset: $0 (0)
  170. acOwner                     ds.l    1                ; offset: $4 (4)
  171. acCTable                 ds.l    1                ; offset: $8 (8)
  172. acFlags                     ds.w    1                ; offset: $C (12)
  173. acReserved                 ds.l    1                ; offset: $E (14)
  174. acRefCon                 ds.l    1                ; offset: $12 (18)
  175. sizeof                     EQU *                    ; size:   $16 (22)
  176.                         ENDR
  177. ; typedef struct AuxCtlRec *            AuxCtlPtr
  178.  
  179. ; typedef AuxCtlPtr *                    AuxCtlHandle
  180.  
  181. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  182. ;     • PopUp Menu Private Data Structure                                                                    
  183. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  184. PopupPrivateData        RECORD 0
  185. mHandle                     ds.l    1                ; offset: $0 (0)
  186. mID                         ds.w    1                ; offset: $4 (4)
  187. sizeof                     EQU *                    ; size:   $6 (6)
  188.                         ENDR
  189. ; typedef struct PopupPrivateData *        PopupPrivateDataPtr
  190.  
  191. ; typedef PopupPrivateDataPtr *            PopupPrivateDataHandle
  192.  
  193.  
  194. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  195. ;     • Errors are in the range -30580 .. -30599                                                            
  196. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  197.  
  198. errMessageNotSupported            EQU        -30580
  199. errDataNotSupported                EQU        -30581
  200. errControlDoesntSupportFocus    EQU        -30582
  201. errWindowDoesntSupportFocus        EQU        -30583
  202. errUnknownControl                EQU        -30584
  203. errCouldntSetFocus                EQU        -30585
  204. errNoRootControl                EQU        -30586
  205. errRootAlreadyExists            EQU        -30587
  206. errInvalidPartCode                EQU        -30588
  207. errControlsAlreadyExist            EQU        -30589
  208. errControlIsNotEmbedder            EQU        -30590
  209. errDataSizeMismatch                EQU        -30591
  210. errControlHiddenOrDisabled        EQU        -30592
  211. errWindowRegionCodeInvalid        EQU        -30593
  212. errCantEmbedIntoSelf            EQU        -30594
  213. errCantEmbedRoot                EQU        -30595
  214. errItemNotControl                EQU        -30596
  215. controlInvalidDataVersionErr    EQU        -30597
  216. controlPropertyInvalid            EQU        -5603
  217. controlPropertyNotFoundErr        EQU        -5604
  218. controlHandleInvalidErr            EQU        -30599
  219. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  220. ;     • Control Definition ID’s                                                                            
  221. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  222. ;  Standard System 7 procIDs
  223.  
  224.  
  225. pushButProc                        EQU        0
  226. checkBoxProc                    EQU        1
  227. radioButProc                    EQU        2
  228. scrollBarProc                    EQU        16
  229. popupMenuProc                    EQU        1008
  230.  
  231. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  232. ;     • Control Types and ID’s available only with Appearance 1.0 and later                                
  233. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  234.  
  235.  
  236. kControlSupportsNewMessages        EQU        ' ok '                ; CDEF should return as result of kControlMsgTestNewMsgSupport
  237. ;  focusing part codes 
  238.  
  239. kControlFocusNoPart                EQU        0                    ; tells control to clear its focus
  240. kControlFocusNextPart            EQU        -1                    ; tells control to focus on the next part
  241. kControlFocusPrevPart            EQU        -2                    ; tells control to focus on the previous part
  242. ; typedef SInt16                         ControlFocusPart
  243.  
  244. ;  Use this constant in Get/SetControlData when the data referred to is not            
  245. ;  specific to a part, but rather the entire control, e.g. the list handle of a     
  246. ;  list box control.                                                                
  247.  
  248. kControlEntireControl            EQU        0
  249. ;  Key Filter result codes                                                             
  250. ;                                                                                     
  251. ;  Certain controls can have a keyfilter attached to them. The filter proc should    
  252. ;  return one of the two constants below. If kKeyFilterBlockKey is returned, the    
  253. ;  key is blocked and never makes it to the control. If kKeyFilterPassKey is        
  254. ;  returned, the control receives the keystroke.                                    
  255.  
  256. kControlKeyFilterBlockKey        EQU        0
  257. kControlKeyFilterPassKey        EQU        1
  258. ; typedef SInt16                         ControlKeyFilterResult
  259.  
  260. ; ——————————————————————————————————————————————————————————————————————————————————————
  261. ;      SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  262. ;    The constants below are meta-font numbers which you can use to set a particular
  263. ;    control's font usage. There are essentially two modes you can use: 1) default,
  264. ;    which is essentially the same as it always has been, i.e. it uses the system font, unless
  265. ;    directed to use the window font via a control variant. 2) you can specify to use
  266. ;    the big or small system font in a generic manner. The Big system font is the font
  267. ;    used in menus, etc. Chicago has filled that role for some time now. Small system
  268. ;    font is currently Geneva 10. The meta-font number implies the size and style.
  269. ;    
  270. ;    NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  271. ;                the fore and back color (Static Text is the only one that does, for
  272. ;                backwards compatibility). Also size, face, and addFontSize are ignored
  273. ;                when using the meta-font numbering.
  274. ;
  275.  
  276. ; ——————————————————————————————————————————————————————————————————————————————————————
  277.  
  278.                                                             ; Meta-font numbering - see not above 
  279. kControlFontBigSystemFont        EQU        -1                    ; force to big system font
  280. kControlFontSmallSystemFont        EQU        -2                    ; force to small system font
  281. kControlFontSmallBoldSystemFont    EQU        -3                    ; force to small bold system font
  282. ;  Add these masks together to set the flags field of a ControlFontStyleRec    
  283. ;  They specify which fields to apply to the text. It is important to make    
  284. ;  sure that you specify only the fields that you wish to set.                
  285.  
  286. kControlUseFontMask                EQU        $0001
  287. kControlUseFaceMask                EQU        $0002
  288. kControlUseSizeMask                EQU        $0004
  289. kControlUseForeColorMask        EQU        $0008
  290. kControlUseBackColorMask        EQU        $0010
  291. kControlUseModeMask                EQU        $0020
  292. kControlUseJustMask                EQU        $0040
  293. kControlUseAllMask                EQU        $00FF
  294. kControlAddFontSizeMask            EQU        $0100
  295. ;  flags available in Appearance 1.1 or later 
  296. ;  AddToMetaFont indicates that we want to start with a standard system        
  297. ;  font, but then we'd like to add the other attributes. Normally, the meta    
  298. ;  font ignores all other flags                                             
  299.  
  300. kControlAddToMetaFontMask        EQU        $0200
  301. ControlFontStyleRec        RECORD 0
  302. flags                     ds.w    1                ; offset: $0 (0)
  303. font                     ds.w    1                ; offset: $2 (2)
  304. size                     ds.w    1                ; offset: $4 (4)
  305. style                     ds.w    1                ; offset: $6 (6)
  306. mode                     ds.w    1                ; offset: $8 (8)
  307. just                     ds.w    1                ; offset: $A (10)
  308. foreColor                 ds        RGBColor        ; offset: $C (12)
  309. backColor                 ds        RGBColor        ; offset: $12 (18)
  310. sizeof                     EQU *                    ; size:   $18 (24)
  311.                         ENDR
  312. ; typedef struct ControlFontStyleRec *    ControlFontStylePtr
  313.  
  314. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  315. ;     • Common data tags for Get/SetControlData                                                            
  316. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  317.  
  318. kControlFontStyleTag            EQU        'font'
  319. kControlKeyFilterTag            EQU        'fltr'
  320.  
  321. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  322. ;     • Control Feature Bits                                                                                
  323. ; ——————————————————————————————————————————————————————————————————————————————————————————————————————
  324.  
  325.                                                             ; Control feature bits - returned by GetControlFeatures 
  326. kControlSupportsGhosting        EQU        $01
  327. kControlSupportsEmbedding        EQU        $02
  328. kControlSupportsFocus            EQU        $04
  329. kControlWantsIdle                EQU        $08
  330. kControlWantsActivate            EQU        $10
  331. kControlHandlesTracking            EQU        $20
  332. kControlSupportsDataAccess        EQU        $40
  333. kControlHasSpecialBackground    EQU        $80
  334. kControlGetsFocusOnClick        EQU        $0100
  335. kControlSupportsCalcBestRect    EQU        $0200
  336. kControlSupportsLiveFeedback    EQU        $0400
  337. ;  Features introduced in Appearance 1.0.1 
  338.  
  339. kControlHasRadioBehavior        EQU        $0800
  340. ;  Features introduced in Appearance 1.1 
  341.  
  342. kControlAutoToggles                EQU        $4000
  343. kControlSupportsGetRegion        EQU        $00020000
  344. ;  Control Messages 
  345.  
  346. kControlMsgDrawGhost            EQU        13
  347. kControlMsgCalcBestRect            EQU        14                    ; Calculate best fitting rectangle for control
  348. kControlMsgHandleTracking        EQU        15
  349. kControlMsgFocus                EQU        16                    ; param indicates action.
  350. kControlMsgKeyDown                EQU        17
  351. kControlMsgIdle                    EQU        18
  352. kControlMsgGetFeatures            EQU        19
  353. kControlMsgSetData                EQU        20
  354. kControlMsgGetData                EQU        21
  355. kControlMsgActivate                EQU        22
  356. kControlMsgSetUpBackground        EQU        23
  357. kControlMsgCalcValueFromPos        EQU        26
  358. kControlMsgTestNewMsgSupport    EQU        27                    ; See if this control supports new messaging
  359. ;  Messages in Appearance 1.0.1 or later
  360.  
  361. kControlMsgSubValueChanged        EQU        25
  362. kControlMsgSubControlAdded        EQU        28
  363. kControlMsgSubControlRemoved    EQU        29
  364. ;  Messages in Appearance 1.1 or later 
  365.  
  366. kControlMsgApplyTextColor        EQU        30
  367. kControlMsgGetRegion            EQU        31
  368. ; ——————————————————————————————————————————————————————————————————————————————————————
  369. ;      This structure is passed into a CDEF when called with the kControlMsgHandleTracking    
  370. ;     message                                                                             
  371. ; ——————————————————————————————————————————————————————————————————————————————————————
  372. ControlTrackingRec        RECORD 0
  373. startPt                     ds        Point            ; offset: $0 (0)
  374. modifiers                 ds.w    1                ; offset: $4 (4)
  375. action                     ds.l    1                ; offset: $6 (6)
  376. sizeof                     EQU *                    ; size:   $A (10)
  377.                         ENDR
  378. ; typedef struct ControlTrackingRec *    ControlTrackingPtr
  379.  
  380. ; ——————————————————————————————————————————————————————————————————————————————————————
  381. ;  This structure is passed into a CDEF when called with the kControlMsgKeyDown message 
  382. ; ——————————————————————————————————————————————————————————————————————————————————————
  383. ControlKeyDownRec        RECORD 0
  384. modifiers                 ds.w    1                ; offset: $0 (0)
  385. keyCode                     ds.w    1                ; offset: $2 (2)
  386. charCode                 ds.w    1                ; offset: $4 (4)
  387. sizeof                     EQU *                    ; size:   $6 (6)
  388.                         ENDR
  389. ; typedef struct ControlKeyDownRec *    ControlKeyDownPtr
  390.  
  391. ; ——————————————————————————————————————————————————————————————————————————————————————
  392. ;  This structure is passed into a CDEF when called with the kControlMsgGetData or        
  393. ;  kControlMsgSetData message                                                             
  394. ; ——————————————————————————————————————————————————————————————————————————————————————
  395. ControlDataAccessRec    RECORD 0
  396. tag                         ds.l    1                ; offset: $0 (0)
  397. part                     ds.l    1                ; offset: $4 (4)
  398. size                     ds.l    1                ; offset: $8 (8)
  399. dataPtr                     ds.l    1                ; offset: $C (12)
  400. sizeof                     EQU *                    ; size:   $10 (16)
  401.                         ENDR
  402. ; typedef struct ControlDataAccessRec *    ControlDataAccessPtr
  403.  
  404. ; ——————————————————————————————————————————————————————————————————————————————————————
  405. ;  This structure is passed into a CDEF when called with the kControlCalcBestRect msg     
  406. ; ——————————————————————————————————————————————————————————————————————————————————————
  407. ControlCalcSizeRec        RECORD 0
  408. height                     ds.w    1                ; offset: $0 (0)
  409. width                     ds.w    1                ; offset: $2 (2)
  410. baseLine                 ds.w    1                ; offset: $4 (4)
  411. sizeof                     EQU *                    ; size:   $6 (6)
  412.                         ENDR
  413. ; typedef struct ControlCalcSizeRec *    ControlCalcSizePtr
  414.  
  415. ; ——————————————————————————————————————————————————————————————————————————————————————
  416. ;  This structure is passed into a CDEF when called with the kControlMsgSetUpBackground 
  417. ;  message is sent                                                                        
  418. ; ——————————————————————————————————————————————————————————————————————————————————————
  419. ControlBackgroundRec    RECORD 0
  420. depth                     ds.w    1                ; offset: $0 (0)
  421. colorDevice                 ds.b    1                ; offset: $2 (2)
  422.                          ORG 4
  423. sizeof                     EQU *                    ; size:   $4 (4)
  424.                         ENDR
  425. ; typedef struct ControlBackgroundRec *    ControlBackgroundPtr
  426.  
  427. ; ——————————————————————————————————————————————————————————————————————————————————————
  428. ;  This structure is passed into a CDEF when called with the kControlMsgApplyTextColor    
  429. ;  message is sent                                                                        
  430. ; ——————————————————————————————————————————————————————————————————————————————————————
  431. ControlApplyTextColorRec RECORD 0
  432. depth                     ds.w    1                ; offset: $0 (0)
  433. colorDevice                 ds.b    1                ; offset: $2 (2)
  434. active                     ds.b    1                ; offset: $3 (3)
  435. sizeof                     EQU *                    ; size:   $4 (4)
  436.                         ENDR
  437. ; typedef struct ControlApplyTextColorRec * ControlApplyTextColorPtr
  438.  
  439. ; ——————————————————————————————————————————————————————————————————————————————————————
  440. ;  This structure is passed into a CDEF when called with the kControlMsgGetRegion        
  441. ;  message is sent                                                                        
  442. ; ——————————————————————————————————————————————————————————————————————————————————————
  443. ControlGetRegionRec        RECORD 0
  444. region                     ds.l    1                ; offset: $0 (0)
  445. part                     ds.w    1                ; offset: $4 (4)
  446. sizeof                     EQU *                    ; size:   $6 (6)
  447.                         ENDR
  448. ; typedef struct ControlGetRegionRec *    ControlGetRegionPtr
  449.  
  450. ; ——————————————————————————————————————————————————————————————————————————————————————
  451. ;     Key Filter                                                                            
  452. ;                                                                                         
  453. ;  Definition of a key filter for intercepting and possibly changing keystrokes            
  454. ;  which are destined for a control                                                        
  455. ; ——————————————————————————————————————————————————————————————————————————————————————
  456. ; ——————————————————————————————————————————————————————————————————————————————————————
  457. ;     • BEVEL BUTTON INTERFACE (CDEF 2)                                                    
  458. ; ——————————————————————————————————————————————————————————————————————————————————————
  459. ;     Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior    
  460. ;  (pushbutton/toggle/sticky), and the bevel size. You also have the option of            
  461. ;     attaching a menu to it. When a menu is present, you can specify which way the         
  462. ;     popup arrow is facing (down or right).                                                
  463. ;                                                                                         
  464. ;     This is all made possible by overloading the Min, Max, and Value parameters for the    
  465. ;     control, as well as adjusting the variant. Here's the breakdown of what goes where:    
  466. ;                                                                                         
  467. ;     Parameter                    What Goes Here                                            
  468. ;     ———————————————————            ————————————————————————————————————————————————————    
  469. ;     Min                            Hi Byte = Behavior, Lo Byte = content type.                
  470. ;     Max                            ResID for resource-based content types.                    
  471. ;     Value                        MenuID to attach, 0 = no menu, please.                    
  472. ;                                                                                         
  473. ;     The variant is broken down into two halfs. The low 2 bits control the bevel type.    
  474. ;     Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls    
  475. ;     whether or not to use the control's owning window's font.                            
  476. ;                                                                                         
  477. ;     Constants for all you need to put this together are below. The values for behaviors    
  478. ;     are set up so that you can simply add them to the content type and pass them into    
  479. ;     the Min parameter of NewControl.                                                    
  480. ;                                                                                         
  481. ;     An example call:                                                                    
  482. ;                                                                                         
  483. ;     control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +         
  484. ;                             kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,    
  485. ;                             0L );                                                        
  486. ;                                                                                         
  487. ;     Attaching a menu:                                                                    
  488. ;                                                                                         
  489. ;     control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,    
  490. ;             myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );    
  491. ;                                                                                         
  492. ;     This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.
  493. ;     This also puts the menu up to the right of the button. You can also specify that a    
  494. ;     menu can have multiple items checked at once by adding kBehaviorMultiValueMenus        
  495. ;     into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue    
  496. ;     helper function will return the last item chosen from the menu, whether or not it    
  497. ;     was checked.                                                                        
  498. ;                                                                                         
  499. ;     NOTE:     Bevel buttons with menus actually have *two* values. The value of the         
  500. ;             button (on/off), and the value of the menu. The menu value can be gotten    
  501. ;             with the GetBevelButtonMenuValue helper function.                            
  502. ;                                                                                         
  503. ;     Handle-based Content                                                                
  504. ;     ————————————————————                                                                
  505. ;     You can create your control and then set the content to an existing handle to an    
  506. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  507. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  508. ;     not try to dispose of handle-based content. If you are changing the content type of    
  509. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  510. ;     based content with a resource-based content to properly dispose of the handle,        
  511. ;     else a memory leak will ensue.                                                        
  512. ;                                                                                         
  513.  
  514.                                                             ; Bevel Button Proc IDs 
  515. kControlBevelButtonSmallBevelProc EQU    32
  516. kControlBevelButtonNormalBevelProc EQU    33
  517. kControlBevelButtonLargeBevelProc EQU    34
  518.  
  519.                                                             ; Bevel button graphic alignment values 
  520. kControlBevelButtonAlignSysDirection EQU -1                    ; only left or right
  521. kControlBevelButtonAlignCenter    EQU        0
  522. kControlBevelButtonAlignLeft    EQU        1
  523. kControlBevelButtonAlignRight    EQU        2
  524. kControlBevelButtonAlignTop        EQU        3
  525. kControlBevelButtonAlignBottom    EQU        4
  526. kControlBevelButtonAlignTopLeft    EQU        5
  527. kControlBevelButtonAlignBottomLeft EQU    6
  528. kControlBevelButtonAlignTopRight EQU    7
  529. kControlBevelButtonAlignBottomRight EQU    8
  530. ; typedef SInt16                         ControlButtonGraphicAlignment
  531.  
  532.  
  533.                                                             ; Bevel button text alignment values 
  534. kControlBevelButtonAlignTextSysDirection EQU 0
  535. kControlBevelButtonAlignTextCenter EQU    1
  536. kControlBevelButtonAlignTextFlushRight EQU -1
  537. kControlBevelButtonAlignTextFlushLeft EQU -2
  538. ; typedef SInt16                         ControlButtonTextAlignment
  539.  
  540.  
  541.                                                             ; Bevel button text placement values 
  542. kControlBevelButtonPlaceSysDirection EQU -1                    ; if graphic on right, then on left
  543. kControlBevelButtonPlaceNormally EQU    0
  544. kControlBevelButtonPlaceToRightOfGraphic EQU 1
  545. kControlBevelButtonPlaceToLeftOfGraphic EQU 2
  546. kControlBevelButtonPlaceBelowGraphic EQU 3
  547. kControlBevelButtonPlaceAboveGraphic EQU 4
  548. ; typedef SInt16                         ControlButtonTextPlacement
  549.  
  550. ;  Add these variant codes to kBevelButtonSmallBevelProc to change the type of button 
  551.  
  552. kControlBevelButtonSmallBevelVariant EQU 0
  553. kControlBevelButtonNormalBevelVariant EQU $01
  554. kControlBevelButtonLargeBevelVariant EQU $02
  555. kControlBevelButtonMenuOnRight    EQU        $04
  556.  
  557. ;   Behaviors of bevel buttons. These are set up so you can add
  558. ;   them together with the content types.
  559.  
  560.  
  561.  
  562. kControlBehaviorPushbutton        EQU        0
  563. kControlBehaviorToggles            EQU        $0100
  564. kControlBehaviorSticky            EQU        $0200
  565. kControlBehaviorMultiValueMenu    EQU        $4000                ; only makes sense when a menu is attached.
  566. kControlBehaviorOffsetContents    EQU        $8000
  567. ;  Behaviors for 1.0.1 or later 
  568.  
  569. kControlBehaviorCommandMenu        EQU        $2000                ; menu holds commands, not choices. Overrides multi-value bit.
  570. ;  Content types supported by bevel buttons *and* image wells
  571.  
  572. kControlContentTextOnly            EQU        0
  573. kControlContentIconSuiteRes        EQU        1
  574. kControlContentCIconRes            EQU        2
  575. kControlContentPictRes            EQU        3
  576. kControlContentIconSuiteHandle    EQU        129
  577. kControlContentCIconHandle        EQU        130
  578. kControlContentPictHandle        EQU        131
  579. kControlContentIconRef            EQU        132
  580. ; typedef SInt16                         ControlContentType
  581.  
  582. ;  Data tags supported by the bevel button controls 
  583.  
  584. kControlBevelButtonContentTag    EQU        'cont'                ; ButtonContentInfo
  585. kControlBevelButtonTransformTag    EQU        'tran'                ; IconTransformType
  586. kControlBevelButtonTextAlignTag    EQU        'tali'                ; ButtonTextAlignment
  587. kControlBevelButtonTextOffsetTag EQU    'toff'                ; SInt16
  588. kControlBevelButtonGraphicAlignTag EQU    'gali'                ; ButtonGraphicAlignment
  589. kControlBevelButtonGraphicOffsetTag EQU    'goff'                ; Point
  590. kControlBevelButtonTextPlaceTag    EQU        'tplc'                ; ButtonTextPlacement
  591. kControlBevelButtonMenuValueTag    EQU        'mval'                ; SInt16
  592. kControlBevelButtonMenuHandleTag EQU    'mhnd'                ; MenuHandle
  593. kControlBevelButtonCenterPopupGlyphTag EQU 'pglc'            ; Boolean: true = center, false = bottom right
  594. ;  These are tags in 1.0.1 or later 
  595.  
  596. kControlBevelButtonLastMenuTag    EQU        'lmnu'                ; SInt16: menuID of last menu item selected from
  597. kControlBevelButtonMenuDelayTag    EQU        'mdly'                ; SInt32: ticks to delay before menu appears
  598. ;  tags available with Appearance 1.1 or later 
  599.  
  600.                                                             ; Boolean: True = if an icon of the ideal size for
  601.                                                             ; the button isn't available, scale a larger or
  602.                                                             ; smaller icon to the ideal size. False = don't
  603.                                                             ; scale; draw a smaller icon or clip a larger icon.
  604.                                                             ; Default is false. Only applies to IconSuites and
  605. kControlBevelButtonScaleIconTag    EQU        'scal'                ; IconRefs.
  606. ;  Structure to pass into bevel buttons and image wells to set/get content type 
  607. ControlButtonContentInfo RECORD 0
  608. contentType                 ds.w    1                ; offset: $0 (0)
  609. resID                     ds.w    1                ; offset: $2 (2)
  610.                          ORG 2
  611. cIconHandle                 ds.l    1                ; offset: $2 (2)
  612.                          ORG 2
  613. iconSuite                 ds.l    1                ; offset: $2 (2)
  614.                          ORG 2
  615. iconRef                     ds.l    1                ; offset: $2 (2)
  616.                          ORG 2
  617. picture                     ds.l    1                ; offset: $2 (2)
  618. sizeof                     EQU *                    ; size:   $6 (6)
  619.                         ENDR
  620. ; typedef struct ControlButtonContentInfo * ControlButtonContentInfoPtr
  621.  
  622. ; ——————————————————————————————————————————————————————————————————————————————————————
  623. ;     • SLIDER (CDEF 3)                                                                    
  624. ; ——————————————————————————————————————————————————————————————————————————————————————
  625. ;     There are several variants that control the behavior of the slider control. Any        
  626. ;     combination of the following three constants can be added to the basic CDEF ID        
  627. ;     (kSliderProc).                                                                        
  628. ;                                                                                         
  629. ;     Variants:                                                                            
  630. ;                                                                                         
  631. ;         kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.    
  632. ;                                 ActionProc is called (set via SetControlAction) as the    
  633. ;                                 indicator is dragged. The value is updated so that the    
  634. ;                                 actionproc can adjust some other property based on the    
  635. ;                                 value each time the action proc is called. If no action    
  636. ;                                 proc is installed, it reverts to the ghost indicator.    
  637. ;                                                                                         
  638. ;         kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control            
  639. ;                                 rectangle must be large enough to accomidate the tick    
  640. ;                                 marks.                                                    
  641. ;                                                                                         
  642. ;         kSliderReverseDirection    Slider thumb points in opposite direction than normal.    
  643. ;                                 If the slider is vertical, the thumb will point to the    
  644. ;                                 left, if the slider is horizontal, the thumb will point    
  645. ;                                 upwards.                                                
  646. ;                                                                                         
  647. ;         kSliderNonDirectional    This option overrides the kSliderReverseDirection and    
  648. ;                                 kSliderHasTickMarks variants. It creates an indicator    
  649. ;                                 which is rectangular and doesn't point in any direction    
  650. ;                                 like the normal indicator does.                            
  651.  
  652.                                                             ; Slider proc IDs 
  653. kControlSliderProc                EQU        48
  654. kControlSliderLiveFeedback        EQU        $01
  655. kControlSliderHasTickMarks        EQU        $02
  656. kControlSliderReverseDirection    EQU        $04
  657. kControlSliderNonDirectional    EQU        $08
  658.  
  659. ; ——————————————————————————————————————————————————————————————————————————————————————
  660. ;     • DISCLOSURE TRIANGLE (CDEF 4)                                                        
  661. ; ——————————————————————————————————————————————————————————————————————————————————————
  662. ;     This control can be used as either left or right facing. It can also handle its own    
  663. ;     tracking if you wish. This means that when the 'autotoggle' variant is used, if the    
  664. ;     user clicks the control, it's state will change automatically from open to closed    
  665. ;     and vice-versa depending on its initial state. After a successful call to Track-    
  666. ;      Control, you can just check the current value to see what state it was switched to.    
  667.  
  668.                                                             ; Triangle proc IDs 
  669. kControlTriangleProc            EQU        64
  670. kControlTriangleLeftFacingProc    EQU        65
  671. kControlTriangleAutoToggleProc    EQU        66
  672. kControlTriangleLeftFacingAutoToggleProc EQU 67
  673.  
  674.                                                             ; Tagged data supported by disclosure triangles 
  675. kControlTriangleLastValueTag    EQU        'last'                ; SInt16
  676. ; ——————————————————————————————————————————————————————————————————————————————————————
  677. ;     • PROGRESS INDICATOR (CDEF 5)                                                        
  678. ; ——————————————————————————————————————————————————————————————————————————————————————
  679. ;     This CDEF implements both determinate and indeterminate progress bars. To switch,     
  680. ;     just use SetControlData to set the indeterminate flag to make it indeterminate call    
  681. ;     IdleControls to step thru the animation. IdleControls should be called at least        
  682. ;     once during your event loop.                                                        
  683. ;                                                                                         
  684.  
  685.                                                             ; Progress Bar proc IDs 
  686. kControlProgressBarProc            EQU        80
  687.  
  688.                                                             ; Tagged data supported by progress bars 
  689. kControlProgressBarIndeterminateTag EQU    'inde'                ; Boolean
  690. ; ——————————————————————————————————————————————————————————————————————————————————————
  691. ;     • LITTLE ARROWS (CDEF 6)                                                            
  692. ; ——————————————————————————————————————————————————————————————————————————————————————
  693. ;      This control implements the little up and down arrows you'd see in the Memory        
  694. ;     control panel for adjusting the cache size.                                         
  695.  
  696.                                                             ; Little Arrows proc IDs 
  697. kControlLittleArrowsProc        EQU        96
  698. ; ——————————————————————————————————————————————————————————————————————————————————————
  699. ;     • CHASING ARROWS (CDEF 7)                                                            
  700. ; ——————————————————————————————————————————————————————————————————————————————————————
  701. ;     To animate this control, make sure to call IdleControls repeatedly.                    
  702. ;                                                                                         
  703.  
  704.                                                             ; Chasing Arrows proc IDs 
  705. kControlChasingArrowsProc        EQU        112
  706. ; ——————————————————————————————————————————————————————————————————————————————————————
  707. ;     • TABS (CDEF 8)                                                                        
  708. ; ——————————————————————————————————————————————————————————————————————————————————————
  709. ;     Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name    
  710. ;     and an icon suite ID for each tab.                                                    
  711. ;                                                                                         
  712. ;     The ID of the tab# resource that you wish to associate with a tab control should     
  713. ;     be passed in as the Value parameter of the control. If you are using GetNewControl, 
  714. ;     then the Value slot in the CNTL resource should have the ID of the 'tab#' resource    
  715. ;     on creation.                                                                        
  716. ;                                                                                         
  717. ;     Passing zero in for the tab# resource tells the control not to read in a tab# res.    
  718. ;     You can then use SetControlMaximum to add tabs, followed by a call to SetControlData
  719. ;     with the kControlTabInfoTag, passing in a pointer to a ControlTabInfoRec. This sets    
  720. ;      the name and optionally an icon for a tab.                                            
  721.  
  722.                                                             ; Tabs proc IDs 
  723. kControlTabLargeProc            EQU        128                    ; Large tab size, north facing    
  724. kControlTabSmallProc            EQU        129                    ; Small tab size, north facing    
  725. kControlTabLargeNorthProc        EQU        128                    ; Large tab size, north facing    
  726. kControlTabSmallNorthProc        EQU        129                    ; Small tab size, north facing    
  727. kControlTabLargeSouthProc        EQU        130                    ; Large tab size, south facing    
  728. kControlTabSmallSouthProc        EQU        131                    ; Small tab size, south facing    
  729. kControlTabLargeEastProc        EQU        132                    ; Large tab size, east facing    
  730. kControlTabSmallEastProc        EQU        133                    ; Small tab size, east facing    
  731. kControlTabLargeWestProc        EQU        134                    ; Large tab size, west facing    
  732. kControlTabSmallWestProc        EQU        135                    ; Small tab size, west facing    
  733.  
  734.                                                             ; Tagged data supported by progress bars 
  735. kControlTabContentRectTag        EQU        'rect'                ; Rect
  736. kControlTabEnabledFlagTag        EQU        'enab'                ; Boolean
  737. kControlTabFontStyleTag            EQU        'font'                ; ControlFontStyleRec
  738. ;  New tags in 1.0.1 or later 
  739.  
  740. kControlTabInfoTag                EQU        'tabi'                ; ControlTabInfoRec
  741.  
  742. kControlTabInfoVersionZero        EQU        0
  743. ControlTabInfoRec        RECORD 0
  744. version                     ds.w    1                ; offset: $0 (0)        ;  version of this structure.
  745. iconSuiteID                 ds.w    1                ; offset: $2 (2)        ;  icon suite to use. Zero indicates no icon
  746. name                     ds        Str255            ; offset: $4 (4)        ;  name to be displayed on the tab
  747. sizeof                     EQU *                    ; size:   $104 (260)
  748.                         ENDR
  749. ; ——————————————————————————————————————————————————————————————————————————————————————
  750. ;     • VISUAL SEPARATOR (CDEF 9)                                                            
  751. ; ——————————————————————————————————————————————————————————————————————————————————————
  752. ;     Separator lines determine their orientation (horizontal or vertical) automatically    
  753. ;     based on the relative height and width of their contrlRect.                            
  754.  
  755.                                                             ; Visual separator proc IDs 
  756. kControlSeparatorLineProc        EQU        144
  757.  
  758. ; ——————————————————————————————————————————————————————————————————————————————————————
  759. ;     • GROUP BOX (CDEF 10)                                                                
  760. ; ——————————————————————————————————————————————————————————————————————————————————————
  761. ;     The group box CDEF can be use in several ways. It can have no title, a text title,     
  762. ;     a check box as the title, or a popup button as a title. There are two versions of     
  763. ;     group boxes, primary and secondary, which look slightly different.                    
  764.  
  765.                                                             ; Group Box proc IDs 
  766. kControlGroupBoxTextTitleProc    EQU        160
  767. kControlGroupBoxCheckBoxProc    EQU        161
  768. kControlGroupBoxPopupButtonProc    EQU        162
  769. kControlGroupBoxSecondaryTextTitleProc EQU 164
  770. kControlGroupBoxSecondaryCheckBoxProc EQU 165
  771. kControlGroupBoxSecondaryPopupButtonProc EQU 166
  772.  
  773.                                                             ; Tagged data supported by group box 
  774. kControlGroupBoxMenuHandleTag    EQU        'mhan'                ; MenuHandle (popup title only)
  775. kControlGroupBoxFontStyleTag    EQU        'font'                ; ControlFontStyleRec
  776. ;  tags available with Appearance 1.1 or later 
  777.  
  778. kControlGroupBoxTitleRectTag    EQU        'trec'                ; Rect. Rectangle that the title text/control is drawn in. (get only)
  779. ; ——————————————————————————————————————————————————————————————————————————————————————
  780. ;     • IMAGE WELL (CDEF 11)                                                                
  781. ; ——————————————————————————————————————————————————————————————————————————————————————
  782. ;     Image Wells allow you to control the content type (pict/icon/etc.) shown in the     
  783. ;     well.                                                                                
  784. ;                                                                                         
  785. ;     This is made possible by overloading the Min and Value parameters for the control.    
  786. ;                                                                                         
  787. ;     Parameter                    What Goes Here                                            
  788. ;     ———————————————————            ——————————————————————————————————————————————————        
  789. ;     Min                            content type (see constants for bevel buttons)            
  790. ;     Value                        Resource ID of content type, if resource-based.            
  791. ;                                                                                         
  792. ;                                                                                         
  793. ;     Handle-based Content                                                                
  794. ;     ————————————————————                                                                
  795. ;     You can create your control and then set the content to an existing handle to an    
  796. ;     icon suite, etc. using the macros below. Please keep in mind that resource-based    
  797. ;     content is owned by the control, handle-based content is owned by you. The CDEF will
  798. ;     not try to dispose of handle-based content. If you are changing the content type of    
  799. ;     the button on the fly, you must make sure that if you are replacing a handle-        
  800. ;     based content with a resource-based content to properly dispose of the handle,        
  801. ;     else a memory leak will ensue.                                                        
  802. ;                                                                                         
  803.  
  804.                                                             ; Image Well proc IDs 
  805. kControlImageWellProc            EQU        176
  806.  
  807.                                                             ; Tagged data supported by image wells 
  808. kControlImageWellContentTag        EQU        'cont'                ; ButtonContentInfo
  809. kControlImageWellTransformTag    EQU        'tran'                ; IconTransformType
  810. ; ——————————————————————————————————————————————————————————————————————————————————————
  811. ;     • POPUP ARROW (CDEF 12)                                                                
  812. ; ——————————————————————————————————————————————————————————————————————————————————————
  813. ;     The popup arrow CDEF is used to draw the small arrow normally associated with a     
  814. ;     popup control. The arrow can point in four directions, and a small or large version 
  815. ;     can be used. This control is provided to allow clients to draw the arrow in a         
  816. ;     normalized fashion which will take advantage of themes automatically.                
  817. ;                                                                                         
  818.  
  819.                                                             ; Popup Arrow proc IDs 
  820. kControlPopupArrowEastProc        EQU        192
  821. kControlPopupArrowWestProc        EQU        193
  822. kControlPopupArrowNorthProc        EQU        194
  823. kControlPopupArrowSouthProc        EQU        195
  824. kControlPopupArrowSmallEastProc    EQU        196
  825. kControlPopupArrowSmallWestProc    EQU        197
  826. kControlPopupArrowSmallNorthProc EQU    198
  827. kControlPopupArrowSmallSouthProc EQU    199
  828. ; ——————————————————————————————————————————————————————————————————————————————————————
  829. ;     • PLACARD (CDEF 14)                                                                    
  830. ; ——————————————————————————————————————————————————————————————————————————————————————
  831.  
  832.                                                             ; Placard proc IDs 
  833. kControlPlacardProc                EQU        224
  834. ; ——————————————————————————————————————————————————————————————————————————————————————
  835. ;     • CLOCK (CDEF 15)                                                                    
  836. ; ——————————————————————————————————————————————————————————————————————————————————————
  837. ;      NOTE:    You can specify more options in the Value paramter when creating the clock.    
  838. ;             See below.                                                                    
  839. ;                                                                                         
  840. ;     NOTE:    Under Appearance 1.1, the clock control knows and returns more part codes.    
  841. ;             The new clock-specific part codes are defined with the other control parts.    
  842. ;             Besides these clock-specific parts, we also return kControlUpButtonPart        
  843. ;             and kControlDownButtonPart when they hit the up and down arrows.            
  844. ;             The new part codes give you more flexibility for focusing and hit testing.    
  845. ;                                                                                         
  846. ;             The original kControlClockPart is still valid. When hit testing, it means    
  847. ;             that some non-editable area of the clock's whitespace has been clicked.        
  848. ;             When focusing a currently unfocused clock, it changes the focus to the        
  849. ;             first part; it is the same as passing kControlFocusNextPart. When            
  850. ;             re-focusing a focused clock, it will not change the focus at all.            
  851.  
  852.                                                             ; Clock proc IDs 
  853. kControlClockTimeProc            EQU        240
  854. kControlClockTimeSecondsProc    EQU        241
  855. kControlClockDateProc            EQU        242
  856. kControlClockMonthYearProc        EQU        243
  857. ; ——————————————————————————————————————————————————————————————————————————————————————
  858. ;      These flags can be passed into 'value' field on creation of the control.            
  859. ;      Value is set to 0 after control is created.                                            
  860. ;                                                                                         
  861. ;     The kClockIsLive value tells the clock to automatically update on idle (clock will    
  862. ;     have the current time). This flag is only valid when the kClockIsDisplayOnly flag    
  863. ;     is set.                                                                                
  864. ; ——————————————————————————————————————————————————————————————————————————————————————
  865.  
  866. kControlClockNoFlags            EQU        0
  867. kControlClockIsDisplayOnly        EQU        1
  868. kControlClockIsLive                EQU        2
  869.  
  870.                                                             ; Tagged data supported by clocks 
  871. kControlClockLongDateTag        EQU        'date'                ; LongDateRec
  872. kControlClockFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  873. ; ——————————————————————————————————————————————————————————————————————————————————————
  874. ;     • USER PANE (CDEF 16)                                                                
  875. ; ——————————————————————————————————————————————————————————————————————————————————————
  876.  
  877.                                                             ; User Pane proc IDs 
  878. kControlUserPaneProc            EQU        256
  879. ;  Tagged data supported by user panes 
  880. ;  Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. 
  881.  
  882. kControlUserItemDrawProcTag        EQU        'uidp'                ; UserItemUPP
  883. kControlUserPaneDrawProcTag        EQU        'draw'                ; ControlUserPaneDrawingUPP
  884. kControlUserPaneHitTestProcTag    EQU        'hitt'                ; ControlUserPaneHitTestUPP
  885. kControlUserPaneTrackingProcTag    EQU        'trak'                ; ControlUserPaneTrackingUPP
  886. kControlUserPaneIdleProcTag        EQU        'idle'                ; ControlUserPaneIdleUPP
  887. kControlUserPaneKeyDownProcTag    EQU        'keyd'                ; ControlUserPaneKeyDownUPP
  888. kControlUserPaneActivateProcTag    EQU        'acti'                ; ControlUserPaneActivateUPP
  889. kControlUserPaneFocusProcTag    EQU        'foci'                ; ControlUserPaneFocusUPP
  890. kControlUserPaneBackgroundProcTag EQU    'back'                ; ControlUserPaneBackgroundUPP
  891.  
  892. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  893. ;      • EDIT TEXT (CDEF 17)
  894. ;  ——————————————————————————————————————————————————————————————————————————————————————————
  895.  
  896.  
  897.  
  898.                                                             ; Edit Text proc IDs 
  899. kControlEditTextProc            EQU        272
  900. kControlEditTextPasswordProc    EQU        274
  901. ;  proc IDs available with Appearance 1.1 or later 
  902.  
  903. kControlEditTextInlineInputProc    EQU        276                    ; Can't combine with the dialog or password variants
  904.  
  905.                                                             ; Tagged data supported by edit text 
  906. kControlEditTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  907. kControlEditTextTextTag            EQU        'text'                ; Buffer of chars - you supply the buffer
  908. kControlEditTextTEHandleTag        EQU        'than'                ; The TEHandle of the text edit record
  909. kControlEditTextKeyFilterTag    EQU        'fltr'
  910. kControlEditTextSelectionTag    EQU        'sele'                ; EditTextSelectionRec
  911. kControlEditTextPasswordTag        EQU        'pass'                ; The clear text password text
  912. ;  tags available with Appearance 1.1 or later 
  913.  
  914. kControlEditTextLockedTag        EQU        'lock'                ; Boolean. Locking disables editability.
  915. kControlEditTextFixedTextTag    EQU        'ftxt'                ; Like the normal text tag, but fixes inline input first
  916. kControlEditTextValidationProcTag EQU    'vali'                ; Called when a key filter can't be: after cut, paste, inline text entry, etc.
  917. kControlEditTextInlinePreUpdateProcTag EQU 'prup'            ; TSMTEPreUpdateUPP and TSMTEPostUpdateUpp (below). For use with inline input variant.
  918. kControlEditTextInlinePostUpdateProcTag EQU 'poup'            ; The refCon parameter will contain the ControlHandle.
  919. ControlEditTextSelectionRec RECORD 0
  920. ;  Structure for getting the edit text selection 
  921. selStart                 ds.w    1                ; offset: $0 (0)
  922. selEnd                     ds.w    1                ; offset: $2 (2)
  923. sizeof                     EQU *                    ; size:   $4 (4)
  924.                         ENDR
  925. ; typedef struct ControlEditTextSelectionRec * ControlEditTextSelectionPtr
  926.  
  927. ; ——————————————————————————————————————————————————————————————————————————————————————
  928. ;     • STATIC TEXT (CDEF 18)                                                                
  929. ; ——————————————————————————————————————————————————————————————————————————————————————
  930. ;  Static Text proc IDs 
  931.  
  932. kControlStaticTextProc            EQU        288
  933. ;  Tagged data supported by static text 
  934.  
  935. kControlStaticTextStyleTag        EQU        'font'                ; ControlFontStyleRec
  936. kControlStaticTextTextTag        EQU        'text'                ; Copy of text
  937. kControlStaticTextTextHeightTag    EQU        'thei'                ; SInt16
  938. ;  Tags available with appearance 1.1 or later 
  939.  
  940. kControlStaticTextTruncTag        EQU        'trun'                ; TruncCode (-1 means no truncation)
  941. ; ——————————————————————————————————————————————————————————————————————————————————————
  942. ;     • PICTURE CONTROL (CDEF 19)                                                            
  943. ; ——————————————————————————————————————————————————————————————————————————————————————
  944. ;     Value parameter should contain the ID of the picture you wish to display when        
  945. ;     creating controls of this type. If you don't want the control tracked at all, use     
  946. ;     the 'no track' variant.                                                                
  947.  
  948.                                                             ; Picture control proc IDs 
  949. kControlPictureProc                EQU        304
  950. kControlPictureNoTrackProc        EQU        305                    ; immediately returns kControlPicturePart
  951. ; ——————————————————————————————————————————————————————————————————————————————————————
  952. ;     • ICON CONTROL (CDEF 20)                                                            
  953. ; ——————————————————————————————————————————————————————————————————————————————————————
  954. ;     Value parameter should contain the ID of the ICON or cicn you wish to display when    
  955. ;     creating controls of this type. If you don't want the control tracked at all, use     
  956. ;     the 'no track' variant.                                                                
  957. ;  Icon control proc IDs 
  958.  
  959. kControlIconProc                EQU        320
  960. kControlIconNoTrackProc            EQU        321                    ; immediately returns kControlIconPart
  961. kControlIconSuiteProc            EQU        322
  962. kControlIconSuiteNoTrackProc    EQU        323                    ; immediately returns kControlIconPart
  963. ;  Tagged data supported by icon controls 
  964.  
  965. kControlIconTransformTag        EQU        'trfm'                ; IconTransformType
  966. kControlIconAlignmentTag        EQU        'algn'                ; IconAlignmentType
  967. ;  Tags available with appearance 1.1 or later 
  968.  
  969. kControlIconResourceIDTag        EQU        'ires'                ; SInt16 resource ID of icon to use
  970. ; ——————————————————————————————————————————————————————————————————————————————————————
  971. ;     • WINDOW HEADER (CDEF 21)                                                            
  972. ; ——————————————————————————————————————————————————————————————————————————————————————
  973.  
  974.                                                             ; Window Header proc IDs 
  975. kControlWindowHeaderProc        EQU        336                    ; normal header
  976. kControlWindowListViewHeaderProc EQU    337                    ; variant for list views - no bottom line
  977. ; ——————————————————————————————————————————————————————————————————————————————————————
  978. ;     • LIST BOX (CDEF 22)                                                                
  979. ; ——————————————————————————————————————————————————————————————————————————————————————
  980. ;     Lists use an auxiliary resource to define their format. The resource type used is     
  981. ;     'ldes' and a definition for it can be found in Appearance.r. The resource ID for     
  982. ;     the ldes is passed in the 'value' parameter when creating the control. You may pass 
  983. ;     zero in value. This tells the List Box control to not use a resource. The list will 
  984. ;     be created with default values, and will use the standard LDEF (0). You can change    
  985. ;     the list by getting the list handle. You can set the LDEF to use by using the tag    
  986. ;     below (kControlListBoxLDEFTag)                                                        
  987.  
  988.                                                             ; List Box proc IDs 
  989. kControlListBoxProc                EQU        352
  990. kControlListBoxAutoSizeProc        EQU        353
  991.  
  992.                                                             ; Tagged data supported by list box 
  993. kControlListBoxListHandleTag    EQU        'lhan'                ; ListHandle
  994. kControlListBoxKeyFilterTag        EQU        'fltr'                ; ControlKeyFilterUPP
  995. kControlListBoxFontStyleTag        EQU        'font'                ; ControlFontStyleRec
  996. ;  New tags in 1.0.1 or later 
  997.  
  998. kControlListBoxDoubleClickTag    EQU        'dblc'                ; Boolean. Was last click a double-click?
  999. kControlListBoxLDEFTag            EQU        'ldef'                ; SInt16. ID of LDEF to use. 
  1000. ; ——————————————————————————————————————————————————————————————————————————————————————
  1001. ;     • PUSH BUTTON (CDEF 23)                                                                
  1002. ; ——————————————————————————————————————————————————————————————————————————————————————
  1003. ;     The new standard checkbox and radio button controls support a "mixed" value that    
  1004. ;     indicates that the current setting contains a mixed set of on and off values. The     
  1005. ;     control value used to display this indication is defined in Controls.h:                
  1006. ;                                                                                         
  1007. ;         kControlCheckBoxMixedValue = 2                                                    
  1008. ;                                                                                         
  1009. ;     Two new variants of the standard pushbutton have been added to the standard control    
  1010. ;     suite that draw a color icon next to the control title. One variant draws the icon    
  1011. ;     on the left side, the other draws it on the right side (when the system justifica-    
  1012. ;     tion is right to left, these are reversed).                                            
  1013. ;                                                                                         
  1014. ;     When either of the icon pushbuttons are created, the contrlMax field of the control 
  1015. ;     record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.    
  1016. ;                                                                                         
  1017. ;     In addition, a push button can now be told to draw with a default outline using the    
  1018. ;     SetControlData routine with the kPushButtonDefaultTag below.                        
  1019. ;                                                                                         
  1020. ;     A push button may also be marked using the kControlPushButtonCancelTag. This has    
  1021. ;     no visible representation, but does cause the button to play the CancelButton theme    
  1022. ;     sound instead of the regular pushbutton theme sound when pressed.                    
  1023. ;                                                                                         
  1024.  
  1025.                                                             ; Theme Push Button/Check Box/Radio Button proc IDs 
  1026. kControlPushButtonProc            EQU        368
  1027. kControlCheckBoxProc            EQU        369
  1028. kControlRadioButtonProc            EQU        370
  1029. kControlPushButLeftIconProc        EQU        374                    ; Standard pushbutton with left-side icon
  1030. kControlPushButRightIconProc    EQU        375                    ; Standard pushbutton with right-side icon
  1031. ;  Variants with Appearance 1.1 or later 
  1032.  
  1033. kControlCheckBoxAutoToggleProc    EQU        371
  1034. kControlRadioButtonAutoToggleProc EQU    372
  1035.  
  1036.                                                             ; Tagged data supported by standard buttons 
  1037. kControlPushButtonDefaultTag    EQU        'dflt'                ; default ring flag 
  1038.  
  1039. kControlPushButtonCancelTag        EQU        'cncl'                ; cancel button flag (1.1 and later) 
  1040. ; ——————————————————————————————————————————————————————————————————————————————————————
  1041. ;     • SCROLL BAR (CDEF 24)                                                                
  1042. ; ——————————————————————————————————————————————————————————————————————————————————————
  1043. ;     This is the new Appearance scroll bar.                                                
  1044. ;                                                                                         
  1045.  
  1046.                                                             ; Theme Scroll Bar proc IDs 
  1047. kControlScrollBarProc            EQU        384                    ; normal scroll bar
  1048. kControlScrollBarLiveProc        EQU        386                    ; live scrolling variant
  1049. ; ——————————————————————————————————————————————————————————————————————————————————————
  1050. ;     • POPUP BUTTON (CDEF 25)                                                            
  1051. ; ——————————————————————————————————————————————————————————————————————————————————————
  1052. ;     This is the new Appearance Popup Button. It takes the same variants and does the     
  1053. ;     same overloading as the previous popup menu control. There are some differences:    
  1054. ;                                                                                         
  1055. ;     Passing in a menu ID of -12345 causes the popup not to try and get the menu from a    
  1056. ;     resource. Instead, you can build the menu and later stuff the menuhandle field in     
  1057. ;     the popup data information.                                                            
  1058. ;                                                                                         
  1059. ;     You can pass -1 in the Max parameter to have the control calculate the width of the    
  1060. ;     title on its own instead of guessing and then tweaking to get it right. It adds the    
  1061. ;     appropriate amount of space between the title and the popup.                        
  1062. ;                                                                                         
  1063.  
  1064.                                                             ; Theme Popup Button proc IDs 
  1065. kControlPopupButtonProc            EQU        400
  1066. kControlPopupFixedWidthVariant    EQU        $01
  1067. kControlPopupVariableWidthVariant EQU    $02
  1068. kControlPopupUseAddResMenuVariant EQU    $04
  1069. kControlPopupUseWFontVariant    EQU        $08                    ; kControlUsesOwningWindowsFontVariant
  1070. ;  These tags are available in 1.0.1 or later of Appearance 
  1071.  
  1072. kControlPopupButtonMenuHandleTag EQU    'mhan'                ; MenuHandle
  1073. kControlPopupButtonMenuIDTag    EQU        'mnid'                ; SInt16
  1074. ;  These tags are available in 1.1 or later of Appearance 
  1075.  
  1076. kControlPopupButtonExtraHeightTag EQU    'exht'                ; SInt16 extra vertical whitespace within the button
  1077. ; ——————————————————————————————————————————————————————————————————————————————————————
  1078. ;     • RADIO GROUP (CDEF 26)                                                                
  1079. ; ——————————————————————————————————————————————————————————————————————————————————————
  1080. ;     This control implements a radio group. It is an embedding control and can therefore    
  1081. ;      only be used when a control hierarchy is established for its owning window. You        
  1082. ;     should only embed radio buttons within it. As radio buttons are embedded into it,    
  1083. ;     the group sets up its value, min, and max to represent the number of embedded items.
  1084. ;     The current value of the control is the index of the sub-control that is the current
  1085. ;     'on' radio button. To get the current radio button control handle, you can use the    
  1086. ;     control manager call GetIndSubControl, passing in the value of the radio group.        
  1087. ;                                                                                         
  1088. ;     NOTE: This control is only available with Appearance 1.0.1.                            
  1089.  
  1090. kControlRadioGroupProc            EQU        416
  1091. ; ——————————————————————————————————————————————————————————————————————————————————————
  1092. ;     • SCROLL TEXT BOX (CDEF 27)                                                            
  1093. ; ——————————————————————————————————————————————————————————————————————————————————————
  1094. ;     This control implements a scrolling box of (non-editable) text.    This is useful for    
  1095. ;     credits in about boxes, etc.                                                        
  1096. ;     The standard version of this control has a scroll bar, but the autoscrolling        
  1097. ;     variant does not. The autoscrolling variant needs two pieces of information to        
  1098. ;     work: delay (in ticks) before the scrolling starts, and time (in ticks) between        
  1099. ;     scrolls. It will scroll one pixel at a time, unless changed via SetControlData.        
  1100. ;                                                                                         
  1101. ;     Parameter                    What Goes Here                                            
  1102. ;     ———————————————————            ————————————————————————————————————————————————————    
  1103. ;     Value                        Resource ID of 'TEXT'/'styl' content.                    
  1104. ;     Min                            Scroll start delay (in ticks)                        .    
  1105. ;     Max                            Delay (in ticks) between scrolls.                        
  1106. ;                                                                                         
  1107. ;     NOTE: This control is only available with Appearance 1.1.                            
  1108.  
  1109. kControlScrollTextBoxProc        EQU        432
  1110. kControlScrollTextBoxAutoScrollProc EQU    433
  1111.  
  1112. kControlScrollTextBoxDelayBeforeAutoScroll EQU 'stdl'        ; UInt32 (ticks until autoscrolling starts)
  1113. kControlScrollTextBoxDelayBetweenAutoScroll EQU 'scdl'        ; UInt32 (ticks between scrolls)
  1114. kControlScrollTextBoxAutoScrollAmount EQU 'samt'            ; UInt16 (pixels per scroll) -- defaults to 1
  1115. kControlScrollTextBoxContents    EQU        'tres'                ; SInt16 (resource ID of 'TEXT'/'styl') -- write only!
  1116.  
  1117. ;   —— end of stuff only available with Appearance 1.0 and later
  1118.  
  1119.  
  1120. ; ——————————————————————————————————————————————————————————————————————————————————————
  1121. ;     • Control Variants                                                                    
  1122. ; ——————————————————————————————————————————————————————————————————————————————————————
  1123. ; typedef SInt16                         ControlVariant
  1124.  
  1125.  
  1126. kControlNoVariant                EQU        0                    ; No variant
  1127. kControlUsesOwningWindowsFontVariant EQU $08                ; Control uses owning windows font to display text
  1128. ; ——————————————————————————————————————————————————————————————————————————————————————
  1129. ;     • Control Part Codes                                                                
  1130. ; ——————————————————————————————————————————————————————————————————————————————————————
  1131.  
  1132. kControlNoPart                    EQU        0
  1133. kControlLabelPart                EQU        1
  1134. kControlMenuPart                EQU        2
  1135. kControlTrianglePart            EQU        4
  1136. kControlEditTextPart            EQU        5                    ; Appearance 1.0 and later
  1137. kControlPicturePart                EQU        6                    ; Appearance 1.0 and later
  1138. kControlIconPart                EQU        7                    ; Appearance 1.0 and later
  1139. kControlClockPart                EQU        8                    ; Appearance 1.0 and later
  1140. kControlListBoxPart                EQU        24                    ; Appearance 1.0 and later
  1141. kControlListBoxDoubleClickPart    EQU        25                    ; Appearance 1.0 and later
  1142. kControlImageWellPart            EQU        26                    ; Appearance 1.0 and later
  1143. kControlRadioGroupPart            EQU        27                    ; Appearance 1.0.2 and later
  1144. kControlButtonPart                EQU        10
  1145. kControlCheckBoxPart            EQU        11
  1146. kControlRadioButtonPart            EQU        11
  1147. kControlUpButtonPart            EQU        20
  1148. kControlDownButtonPart            EQU        21
  1149. kControlPageUpPart                EQU        22
  1150. kControlPageDownPart            EQU        23
  1151. kControlIndicatorPart            EQU        129
  1152. kControlDisabledPart            EQU        254
  1153. kControlInactivePart            EQU        255
  1154.  
  1155. kControlClockHourDayPart        EQU        9                    ; Appearance 1.1 and later
  1156. kControlClockMinuteMonthPart    EQU        10                    ; Appearance 1.1 and later
  1157. kControlClockSecondYearPart        EQU        11                    ; Appearance 1.1 and later
  1158. kControlClockAMPMPart            EQU        12                    ; Appearance 1.1 and later
  1159. ; ——————————————————————————————————————————————————————————————————————————————————————
  1160. ;      Meta-Parts                                                                            
  1161. ;  
  1162. ;/*     If you haven't guessed from looking at other toolbox headers. We like the word         
  1163. ;     'meta'. It's cool. So here's one more for you. A meta-part is a part used in a call    
  1164. ;      to the GetControlRegion API. These parts are parts that might be defined by a        
  1165. ;     control, but should not be returned from calls like TestControl, et al. They define    
  1166. ;      a region of a control, presently the structure and the content region. The content    
  1167. ;      region is only defined by controls that can embed other controls. It is the area    
  1168. ;      that embedded content can live.                                                        
  1169. ;                                                                                         
  1170. ;     Along with these parts, you can also pass in normal part codes to get the regions    
  1171. ;      of the parts. Not all controls fully support this at the time this was written.        
  1172. ; ——————————————————————————————————————————————————————————————————————————————————————
  1173.  
  1174. kControlStructureMetaPart        EQU        -1
  1175. kControlContentMetaPart            EQU        -2
  1176. ; ——————————————————————————————————————————————————————————————————————————————————————
  1177. ;     • Check Box Values                                                                    
  1178. ; ——————————————————————————————————————————————————————————————————————————————————————
  1179.  
  1180. kControlCheckBoxUncheckedValue    EQU        0
  1181. kControlCheckBoxCheckedValue    EQU        1
  1182. kControlCheckBoxMixedValue        EQU        2
  1183. ; ——————————————————————————————————————————————————————————————————————————————————————
  1184. ;     • Radio Button Values                                                                
  1185. ; ——————————————————————————————————————————————————————————————————————————————————————
  1186.  
  1187. kControlRadioButtonUncheckedValue EQU    0
  1188. kControlRadioButtonCheckedValue    EQU        1
  1189. kControlRadioButtonMixedValue    EQU        2
  1190. ; ——————————————————————————————————————————————————————————————————————————————————————
  1191. ;     • Pop-Up Menu Control Constants                                                        
  1192. ; ——————————————————————————————————————————————————————————————————————————————————————
  1193. ;  Variant codes for the System 7 pop-up menu
  1194.  
  1195. popupFixedWidth                    EQU        $01
  1196. popupVariableWidth                EQU        $02
  1197. popupUseAddResMenu                EQU        $04
  1198. popupUseWFont                    EQU        $08
  1199. ;  Menu label styles for the System 7 pop-up menu 
  1200.  
  1201. popupTitleBold                    EQU        $0100
  1202. popupTitleItalic                EQU        $0200
  1203. popupTitleUnderline                EQU        $0400
  1204. popupTitleOutline                EQU        $0800
  1205. popupTitleShadow                EQU        $1000
  1206. popupTitleCondense                EQU        $2000
  1207. popupTitleExtend                EQU        $4000
  1208. popupTitleNoStyle                EQU        $8000
  1209. ;  Menu label justifications for the System 7 pop-up menu
  1210.  
  1211. popupTitleLeftJust                EQU        $00000000
  1212. popupTitleCenterJust            EQU        $00000001
  1213. popupTitleRightJust                EQU        $000000FF
  1214. ; ——————————————————————————————————————————————————————————————————————————————————————
  1215. ;      • DragGrayRgn Constatns                                                                
  1216. ;                                                                                         
  1217. ;    For DragGrayRgnUPP used in TrackControl()                                             
  1218. ; ——————————————————————————————————————————————————————————————————————————————————————
  1219.  
  1220. noConstraint                    EQU        0
  1221. hAxisOnly                        EQU        1
  1222. vAxisOnly                        EQU        2
  1223. ; ——————————————————————————————————————————————————————————————————————————————————————
  1224. ;     • Control Creation/Deletion                                                            
  1225. ; ——————————————————————————————————————————————————————————————————————————————————————
  1226. ;
  1227. ; pascal ControlHandle NewControl(WindowPtr owningWindow, const Rect *boundsRect, ConstStr255Param controlTitle, Boolean initiallyVisible, SInt16 initialValue, SInt16 minimumValue, SInt16 maximumValue, SInt16 procID, SInt32 controlReference)
  1228. ;
  1229.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1230.         _NewControl:    OPWORD    $A954
  1231.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1232.         IMPORT_CFM_FUNCTION NewControl
  1233.     ENDIF
  1234.  
  1235. ;
  1236. ; pascal ControlHandle GetNewControl(SInt16 resourceID, WindowPtr owningWindow)
  1237. ;
  1238.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1239.         _GetNewControl:    OPWORD    $A9BE
  1240.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1241.         IMPORT_CFM_FUNCTION GetNewControl
  1242.     ENDIF
  1243.  
  1244. ;
  1245. ; pascal void DisposeControl(ControlHandle theControl)
  1246. ;
  1247.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1248.         _DisposeControl:    OPWORD    $A955
  1249.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1250.         IMPORT_CFM_FUNCTION DisposeControl
  1251.     ENDIF
  1252.  
  1253. ;
  1254. ; pascal void KillControls(WindowPtr theWindow)
  1255. ;
  1256.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1257.         _KillControls:    OPWORD    $A956
  1258.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1259.         IMPORT_CFM_FUNCTION KillControls
  1260.     ENDIF
  1261.  
  1262. ; ——————————————————————————————————————————————————————————————————————————————————————
  1263. ;     • Control Visible State                                                                
  1264. ; ——————————————————————————————————————————————————————————————————————————————————————
  1265. ;
  1266. ; pascal void HiliteControl(ControlHandle theControl, ControlPartCode hiliteState)
  1267. ;
  1268.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1269.         _HiliteControl:    OPWORD    $A95D
  1270.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1271.         IMPORT_CFM_FUNCTION HiliteControl
  1272.     ENDIF
  1273.  
  1274. ;
  1275. ; pascal void ShowControl(ControlHandle theControl)
  1276. ;
  1277.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1278.         _ShowControl:    OPWORD    $A957
  1279.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1280.         IMPORT_CFM_FUNCTION ShowControl
  1281.     ENDIF
  1282.  
  1283. ;
  1284. ; pascal void HideControl(ControlHandle theControl)
  1285. ;
  1286.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1287.         _HideControl:    OPWORD    $A958
  1288.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1289.         IMPORT_CFM_FUNCTION HideControl
  1290.     ENDIF
  1291.  
  1292.  
  1293. ;  following state routines available only with Appearance 1.0 and later
  1294. ;
  1295. ; pascal Boolean IsControlActive(ControlHandle inControl)
  1296. ;
  1297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1298.         Macro
  1299.         _IsControlActive
  1300.             move.w              #$0005,D0
  1301.             dc.w                $AA73
  1302.         EndM
  1303.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1304.         IMPORT_CFM_FUNCTION IsControlActive
  1305.     ENDIF
  1306.  
  1307. ;
  1308. ; pascal Boolean IsControlVisible(ControlHandle inControl)
  1309. ;
  1310.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1311.         Macro
  1312.         _IsControlVisible
  1313.             move.w              #$0006,D0
  1314.             dc.w                $AA73
  1315.         EndM
  1316.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1317.         IMPORT_CFM_FUNCTION IsControlVisible
  1318.     ENDIF
  1319.  
  1320. ;
  1321. ; pascal OSErr ActivateControl(ControlHandle inControl)
  1322. ;
  1323.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1324.         Macro
  1325.         _ActivateControl
  1326.             move.w              #$0007,D0
  1327.             dc.w                $AA73
  1328.         EndM
  1329.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1330.         IMPORT_CFM_FUNCTION ActivateControl
  1331.     ENDIF
  1332.  
  1333. ;
  1334. ; pascal OSErr DeactivateControl(ControlHandle inControl)
  1335. ;
  1336.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1337.         Macro
  1338.         _DeactivateControl
  1339.             move.w              #$0008,D0
  1340.             dc.w                $AA73
  1341.         EndM
  1342.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1343.         IMPORT_CFM_FUNCTION DeactivateControl
  1344.     ENDIF
  1345.  
  1346. ;
  1347. ; pascal OSErr SetControlVisibility(ControlHandle inControl, Boolean inIsVisible, Boolean inDoDraw)
  1348. ;
  1349.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1350.         Macro
  1351.         _SetControlVisibility
  1352.             move.w              #$001E,D0
  1353.             dc.w                $AA73
  1354.         EndM
  1355.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1356.         IMPORT_CFM_FUNCTION SetControlVisibility
  1357.     ENDIF
  1358.  
  1359.  
  1360. ; ——————————————————————————————————————————————————————————————————————————————————————
  1361. ;     • Control Imaging                                                                    
  1362. ; ——————————————————————————————————————————————————————————————————————————————————————
  1363. ;
  1364. ; pascal void DrawControls(WindowPtr theWindow)
  1365. ;
  1366.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1367.         _DrawControls:    OPWORD    $A969
  1368.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1369.         IMPORT_CFM_FUNCTION DrawControls
  1370.     ENDIF
  1371.  
  1372. ;
  1373. ; pascal void Draw1Control(ControlHandle theControl)
  1374. ;
  1375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1376.         _Draw1Control:    OPWORD    $A96D
  1377.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1378.         IMPORT_CFM_FUNCTION Draw1Control
  1379.     ENDIF
  1380.  
  1381.  
  1382. ;
  1383. ; pascal void UpdateControls(WindowPtr theWindow, RgnHandle updateRegion)
  1384. ;
  1385.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1386.         _UpdateControls:    OPWORD    $A953
  1387.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1388.         IMPORT_CFM_FUNCTION UpdateControls
  1389.     ENDIF
  1390.  
  1391.  
  1392. ;  following imaging routines available only with Appearance 1.0 and later
  1393. ;
  1394. ; pascal OSErr GetBestControlRect(ControlHandle inControl, Rect *outRect, SInt16 *outBaseLineOffset)
  1395. ;
  1396.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1397.         Macro
  1398.         _GetBestControlRect
  1399.             move.w              #$001B,D0
  1400.             dc.w                $AA73
  1401.         EndM
  1402.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1403.         IMPORT_CFM_FUNCTION GetBestControlRect
  1404.     ENDIF
  1405.  
  1406. ;
  1407. ; pascal OSErr SetControlFontStyle(ControlHandle inControl, const ControlFontStyleRec *inStyle)
  1408. ;
  1409.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1410.         Macro
  1411.         _SetControlFontStyle
  1412.             move.w              #$001C,D0
  1413.             dc.w                $AA73
  1414.         EndM
  1415.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1416.         IMPORT_CFM_FUNCTION SetControlFontStyle
  1417.     ENDIF
  1418.  
  1419. ;
  1420. ; pascal void DrawControlInCurrentPort(ControlHandle inControl)
  1421. ;
  1422.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1423.         Macro
  1424.         _DrawControlInCurrentPort
  1425.             move.w              #$0018,D0
  1426.             dc.w                $AA73
  1427.         EndM
  1428.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1429.         IMPORT_CFM_FUNCTION DrawControlInCurrentPort
  1430.     ENDIF
  1431.  
  1432. ;
  1433. ; pascal OSErr SetUpControlBackground(ControlHandle inControl, SInt16 inDepth, Boolean inIsColorDevice)
  1434. ;
  1435.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1436.         Macro
  1437.         _SetUpControlBackground
  1438.             move.w              #$001D,D0
  1439.             dc.w                $AA73
  1440.         EndM
  1441.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1442.         IMPORT_CFM_FUNCTION SetUpControlBackground
  1443.     ENDIF
  1444.  
  1445. ;  SetUpControlTextColor is available in Appearance 1.1 or later.
  1446. ;
  1447. ; pascal OSErr SetUpControlTextColor(ControlHandle inControl, SInt16 inDepth, Boolean inIsColorDevice)
  1448. ;
  1449.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1450.         IMPORT_CFM_FUNCTION SetUpControlTextColor
  1451.     ENDIF
  1452.  
  1453.  
  1454. ; ——————————————————————————————————————————————————————————————————————————————————————
  1455. ;     • Control Mousing                                                                    
  1456. ; ——————————————————————————————————————————————————————————————————————————————————————
  1457. ;    NOTE ON CONTROL ACTION PROCS
  1458. ;    
  1459. ;    When using the TrackControl() call when tracking an indicator, the actionProc parameter
  1460. ;    (type ControlActionUPP) should be replaced by a parameter of type DragGrayRgnUPP
  1461. ;    (see Quickdraw.h).
  1462. ;    
  1463. ;    If, however, you are using the live feedback variants of scroll bars or sliders, you
  1464. ;    can pass a ControlActionUPP in when tracking the indicator as well. This functionality
  1465. ;    is available in Appearance 1.0 or later.
  1466. ;
  1467.  
  1468. ;
  1469. ; pascal ControlPartCode TrackControl(ControlHandle theControl, Point startPoint, ControlActionUPP actionProc)
  1470. ;
  1471.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1472.         _TrackControl:    OPWORD    $A968
  1473.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1474.         IMPORT_CFM_FUNCTION TrackControl
  1475.     ENDIF
  1476.  
  1477. ;
  1478. ; pascal void DragControl(ControlHandle theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis)
  1479. ;
  1480.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1481.         _DragControl:    OPWORD    $A967
  1482.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1483.         IMPORT_CFM_FUNCTION DragControl
  1484.     ENDIF
  1485.  
  1486. ;
  1487. ; pascal ControlPartCode TestControl(ControlHandle theControl, Point testPoint)
  1488. ;
  1489.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1490.         _TestControl:    OPWORD    $A966
  1491.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1492.         IMPORT_CFM_FUNCTION TestControl
  1493.     ENDIF
  1494.  
  1495. ;
  1496. ; pascal ControlPartCode FindControl(Point testPoint, WindowPtr theWindow, ControlHandle *theControl)
  1497. ;
  1498.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1499.         _FindControl:    OPWORD    $A96C
  1500.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1501.         IMPORT_CFM_FUNCTION FindControl
  1502.     ENDIF
  1503.  
  1504. ;  The following mousing routines available only with Appearance 1.0 and later    
  1505. ;                                                                                 
  1506. ;  FindControlUnderMouse is preferrable to TrackControl when running under        
  1507. ;  Appearance 1.0 as you can pass in modifiers, which some of the new controls    
  1508. ;  use, such as edit text and list boxes.                                        
  1509. ;
  1510. ; pascal ControlHandle FindControlUnderMouse(Point inWhere, WindowPtr inWindow, SInt16 *outPart)
  1511. ;
  1512.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1513.         Macro
  1514.         _FindControlUnderMouse
  1515.             move.w              #$0009,D0
  1516.             dc.w                $AA73
  1517.         EndM
  1518.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1519.         IMPORT_CFM_FUNCTION FindControlUnderMouse
  1520.     ENDIF
  1521.  
  1522. ;
  1523. ; pascal ControlPartCode HandleControlClick(ControlHandle inControl, Point inWhere, SInt16 inModifiers, ControlActionUPP inAction)
  1524. ;
  1525.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1526.         Macro
  1527.         _HandleControlClick
  1528.             move.w              #$000A,D0
  1529.             dc.w                $AA73
  1530.         EndM
  1531.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1532.         IMPORT_CFM_FUNCTION HandleControlClick
  1533.     ENDIF
  1534.  
  1535.  
  1536.  
  1537.  
  1538. ; ——————————————————————————————————————————————————————————————————————————————————————
  1539. ;     • Control Events (available only with Appearance 1.0 and later)                        
  1540. ; ——————————————————————————————————————————————————————————————————————————————————————
  1541. ;
  1542. ; pascal SInt16 HandleControlKey(ControlHandle inControl, SInt16 inKeyCode, SInt16 inCharCode, SInt16 inModifiers)
  1543. ;
  1544.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1545.         Macro
  1546.         _HandleControlKey
  1547.             move.w              #$000B,D0
  1548.             dc.w                $AA73
  1549.         EndM
  1550.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1551.         IMPORT_CFM_FUNCTION HandleControlKey
  1552.     ENDIF
  1553.  
  1554. ;
  1555. ; pascal void IdleControls(WindowPtr inWindow)
  1556. ;
  1557.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1558.         Macro
  1559.         _IdleControls
  1560.             move.w              #$000C,D0
  1561.             dc.w                $AA73
  1562.         EndM
  1563.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1564.         IMPORT_CFM_FUNCTION IdleControls
  1565.     ENDIF
  1566.  
  1567.  
  1568.  
  1569. ; ——————————————————————————————————————————————————————————————————————————————————————
  1570. ;     • Control Positioning                                                                
  1571. ; ——————————————————————————————————————————————————————————————————————————————————————
  1572. ;
  1573. ; pascal void MoveControl(ControlHandle theControl, SInt16 h, SInt16 v)
  1574. ;
  1575.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1576.         _MoveControl:    OPWORD    $A959
  1577.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1578.         IMPORT_CFM_FUNCTION MoveControl
  1579.     ENDIF
  1580.  
  1581. ;
  1582. ; pascal void SizeControl(ControlHandle theControl, SInt16 w, SInt16 h)
  1583. ;
  1584.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1585.         _SizeControl:    OPWORD    $A95C
  1586.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1587.         IMPORT_CFM_FUNCTION SizeControl
  1588.     ENDIF
  1589.  
  1590. ; ——————————————————————————————————————————————————————————————————————————————————————
  1591. ;     • Control Title                                                                        
  1592. ; ——————————————————————————————————————————————————————————————————————————————————————
  1593. ;
  1594. ; pascal void SetControlTitle(ControlHandle theControl, ConstStr255Param title)
  1595. ;
  1596.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1597.         _SetControlTitle:    OPWORD    $A95F
  1598.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1599.         IMPORT_CFM_FUNCTION SetControlTitle
  1600.     ENDIF
  1601.  
  1602. ;
  1603. ; pascal void GetControlTitle(ControlHandle theControl, Str255 title)
  1604. ;
  1605.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1606.         _GetControlTitle:    OPWORD    $A95E
  1607.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1608.         IMPORT_CFM_FUNCTION GetControlTitle
  1609.     ENDIF
  1610.  
  1611. ; ——————————————————————————————————————————————————————————————————————————————————————
  1612. ;     • Control Value                                                                        
  1613. ; ——————————————————————————————————————————————————————————————————————————————————————
  1614. ;
  1615. ; pascal SInt16 GetControlValue(ControlHandle theControl)
  1616. ;
  1617.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1618.         _GetControlValue:    OPWORD    $A960
  1619.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1620.         IMPORT_CFM_FUNCTION GetControlValue
  1621.     ENDIF
  1622.  
  1623. ;
  1624. ; pascal void SetControlValue(ControlHandle theControl, SInt16 newValue)
  1625. ;
  1626.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1627.         _SetControlValue:    OPWORD    $A963
  1628.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1629.         IMPORT_CFM_FUNCTION SetControlValue
  1630.     ENDIF
  1631.  
  1632. ;
  1633. ; pascal SInt16 GetControlMinimum(ControlHandle theControl)
  1634. ;
  1635.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1636.         _GetControlMinimum:    OPWORD    $A961
  1637.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1638.         IMPORT_CFM_FUNCTION GetControlMinimum
  1639.     ENDIF
  1640.  
  1641. ;
  1642. ; pascal void SetControlMinimum(ControlHandle theControl, SInt16 newMinimum)
  1643. ;
  1644.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1645.         _SetControlMinimum:    OPWORD    $A964
  1646.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1647.         IMPORT_CFM_FUNCTION SetControlMinimum
  1648.     ENDIF
  1649.  
  1650. ;
  1651. ; pascal SInt16 GetControlMaximum(ControlHandle theControl)
  1652. ;
  1653.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1654.         _GetControlMaximum:    OPWORD    $A962
  1655.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1656.         IMPORT_CFM_FUNCTION GetControlMaximum
  1657.     ENDIF
  1658.  
  1659. ;
  1660. ; pascal void SetControlMaximum(ControlHandle theControl, SInt16 newMaximum)
  1661. ;
  1662.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1663.         _SetControlMaximum:    OPWORD    $A965
  1664.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1665.         IMPORT_CFM_FUNCTION SetControlMaximum
  1666.     ENDIF
  1667.  
  1668. ;  proportional scrolling/32-bit value support is new with Appearance 1.1
  1669. ;
  1670. ; pascal SInt32 GetControlViewSize(ControlHandle theControl)
  1671. ;
  1672.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1673.         IMPORT_CFM_FUNCTION GetControlViewSize
  1674.     ENDIF
  1675.  
  1676. ;
  1677. ; pascal void SetControlViewSize(ControlHandle theControl, SInt32 newViewSize)
  1678. ;
  1679.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1680.         IMPORT_CFM_FUNCTION SetControlViewSize
  1681.     ENDIF
  1682.  
  1683. ;
  1684. ; pascal SInt32 GetControl32BitValue(ControlHandle theControl)
  1685. ;
  1686.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1687.         IMPORT_CFM_FUNCTION GetControl32BitValue
  1688.     ENDIF
  1689.  
  1690. ;
  1691. ; pascal void SetControl32BitValue(ControlHandle theControl, SInt32 newValue)
  1692. ;
  1693.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1694.         IMPORT_CFM_FUNCTION SetControl32BitValue
  1695.     ENDIF
  1696.  
  1697. ;
  1698. ; pascal SInt32 GetControl32BitMaximum(ControlHandle theControl)
  1699. ;
  1700.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1701.         IMPORT_CFM_FUNCTION GetControl32BitMaximum
  1702.     ENDIF
  1703.  
  1704. ;
  1705. ; pascal void SetControl32BitMaximum(ControlHandle theControl, SInt32 newMaximum)
  1706. ;
  1707.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1708.         IMPORT_CFM_FUNCTION SetControl32BitMaximum
  1709.     ENDIF
  1710.  
  1711. ;
  1712. ; pascal SInt32 GetControl32BitMinimum(ControlHandle theControl)
  1713. ;
  1714.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1715.         IMPORT_CFM_FUNCTION GetControl32BitMinimum
  1716.     ENDIF
  1717.  
  1718. ;
  1719. ; pascal void SetControl32BitMinimum(ControlHandle theControl, SInt32 newMinimum)
  1720. ;
  1721.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1722.         IMPORT_CFM_FUNCTION SetControl32BitMinimum
  1723.     ENDIF
  1724.  
  1725.  
  1726. ;       IsValidControlHandle will tell you if the handle you pass in belongs to a control
  1727. ;      the Control Manager knows about. It does not sanity check the data in the control.
  1728.  
  1729.  
  1730.  
  1731. ;
  1732. ; pascal Boolean IsValidControlHandle(ControlHandle theControl)
  1733. ;
  1734.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1735.         IMPORT_CFM_FUNCTION IsValidControlHandle
  1736.     ENDIF
  1737.  
  1738. ; ——————————————————————————————————————————————————————————————————————————————————————
  1739. ;  • Properties                                                                            
  1740. ; ——————————————————————————————————————————————————————————————————————————————————————
  1741. ;
  1742. ; pascal OSStatus GetControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer)
  1743. ;
  1744.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1745.         IMPORT_CFM_FUNCTION GetControlProperty
  1746.     ENDIF
  1747.  
  1748. ;
  1749. ; pascal OSStatus GetControlPropertySize(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 *size)
  1750. ;
  1751.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1752.         IMPORT_CFM_FUNCTION GetControlPropertySize
  1753.     ENDIF
  1754.  
  1755. ;
  1756. ; pascal OSStatus SetControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag, UInt32 propertySize, void *propertyData)
  1757. ;
  1758.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1759.         IMPORT_CFM_FUNCTION SetControlProperty
  1760.     ENDIF
  1761.  
  1762. ;
  1763. ; pascal OSStatus RemoveControlProperty(ControlHandle control, OSType propertyCreator, OSType propertyTag)
  1764. ;
  1765.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1766.         IMPORT_CFM_FUNCTION RemoveControlProperty
  1767.     ENDIF
  1768.  
  1769.  
  1770. ; ——————————————————————————————————————————————————————————————————————————————————————
  1771. ;     • Control Regions (Appearance 1.1 or later)                                            
  1772. ;                                                                                         
  1773. ;     See the discussion on meta-parts in this header for more information                
  1774. ; ——————————————————————————————————————————————————————————————————————————————————————
  1775. ;
  1776. ; pascal OSStatus GetControlRegion(ControlHandle inControl, ControlPartCode inPart, RgnHandle outRegion)
  1777. ;
  1778.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1779.         IMPORT_CFM_FUNCTION GetControlRegion
  1780.     ENDIF
  1781.  
  1782. ; ——————————————————————————————————————————————————————————————————————————————————————
  1783. ;     • Control Variant                                                                    
  1784. ; ——————————————————————————————————————————————————————————————————————————————————————
  1785. ;
  1786. ; pascal ControlVariant GetControlVariant(ControlHandle theControl)
  1787. ;
  1788.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1789.         _GetControlVariant:    OPWORD    $A809
  1790.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1791.         IMPORT_CFM_FUNCTION GetControlVariant
  1792.     ENDIF
  1793.  
  1794. ; ——————————————————————————————————————————————————————————————————————————————————————
  1795. ;     • Control Action                                                                    
  1796. ; ——————————————————————————————————————————————————————————————————————————————————————
  1797. ;
  1798. ; pascal void SetControlAction(ControlHandle theControl, ControlActionUPP actionProc)
  1799. ;
  1800.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1801.         _SetControlAction:    OPWORD    $A96B
  1802.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1803.         IMPORT_CFM_FUNCTION SetControlAction
  1804.     ENDIF
  1805.  
  1806. ;
  1807. ; pascal ControlActionUPP GetControlAction(ControlHandle theControl)
  1808. ;
  1809.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1810.         _GetControlAction:    OPWORD    $A96A
  1811.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1812.         IMPORT_CFM_FUNCTION GetControlAction
  1813.     ENDIF
  1814.  
  1815. ; ——————————————————————————————————————————————————————————————————————————————————————
  1816. ;  • Control Accessors                                                                    
  1817. ; ——————————————————————————————————————————————————————————————————————————————————————
  1818. ;
  1819. ; pascal void SetControlReference(ControlHandle theControl, SInt32 data)
  1820. ;
  1821.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1822.         _SetControlReference:    OPWORD    $A95B
  1823.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1824.         IMPORT_CFM_FUNCTION SetControlReference
  1825.     ENDIF
  1826.  
  1827. ;
  1828. ; pascal SInt32 GetControlReference(ControlHandle theControl)
  1829. ;
  1830.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1831.         _GetControlReference:    OPWORD    $A95A
  1832.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1833.         IMPORT_CFM_FUNCTION GetControlReference
  1834.     ENDIF
  1835.  
  1836. ;
  1837. ; pascal Boolean GetAuxiliaryControlRecord(ControlHandle theControl, AuxCtlHandle *acHndl)
  1838. ;
  1839.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1840.         _GetAuxiliaryControlRecord:    OPWORD    $AA44
  1841.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1842.         IMPORT_CFM_FUNCTION GetAuxiliaryControlRecord
  1843.     ENDIF
  1844.  
  1845. ;
  1846. ; pascal void SetControlColor(ControlHandle theControl, CCTabHandle newColorTable)
  1847. ;
  1848.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1849.         _SetControlColor:    OPWORD    $AA43
  1850.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1851.         IMPORT_CFM_FUNCTION SetControlColor
  1852.     ENDIF
  1853.  
  1854. ; ——————————————————————————————————————————————————————————————————————————————————————
  1855. ;     • HELPERS (available only with Appearance 1.0 and later)                            
  1856. ;                                                                                         
  1857. ;  These routines are available only thru the shared library/glue                        
  1858. ;  Bevel button routines                                                                
  1859. ; ——————————————————————————————————————————————————————————————————————————————————————
  1860.  
  1861. ;
  1862. ; pascal OSErr GetBevelButtonMenuValue(ControlHandle inButton, SInt16 *outValue)
  1863. ;
  1864.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1865.         IMPORT_CFM_FUNCTION GetBevelButtonMenuValue
  1866.     ENDIF
  1867.  
  1868. ;
  1869. ; pascal OSErr SetBevelButtonMenuValue(ControlHandle inButton, SInt16 inValue)
  1870. ;
  1871.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1872.         IMPORT_CFM_FUNCTION SetBevelButtonMenuValue
  1873.     ENDIF
  1874.  
  1875. ;
  1876. ; pascal OSErr GetBevelButtonMenuHandle(ControlHandle inButton, MenuHandle *outHandle)
  1877. ;
  1878.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1879.         IMPORT_CFM_FUNCTION GetBevelButtonMenuHandle
  1880.     ENDIF
  1881.  
  1882. ;
  1883. ; pascal OSErr GetBevelButtonContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr outContent)
  1884. ;
  1885.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1886.         IMPORT_CFM_FUNCTION GetBevelButtonContentInfo
  1887.     ENDIF
  1888.  
  1889. ;
  1890. ; pascal OSErr SetBevelButtonContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr inContent)
  1891. ;
  1892.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1893.         IMPORT_CFM_FUNCTION SetBevelButtonContentInfo
  1894.     ENDIF
  1895.  
  1896. ;
  1897. ; pascal OSErr SetBevelButtonTransform(ControlHandle inButton, IconTransformType transform)
  1898. ;
  1899.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1900.         IMPORT_CFM_FUNCTION SetBevelButtonTransform
  1901.     ENDIF
  1902.  
  1903. ;
  1904. ; pascal OSErr SetBevelButtonGraphicAlignment(ControlHandle inButton, ControlButtonGraphicAlignment inAlign, SInt16 inHOffset, SInt16 inVOffset)
  1905. ;
  1906.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1907.         IMPORT_CFM_FUNCTION SetBevelButtonGraphicAlignment
  1908.     ENDIF
  1909.  
  1910. ;
  1911. ; pascal OSErr SetBevelButtonTextAlignment(ControlHandle inButton, ControlButtonTextAlignment inAlign, SInt16 inHOffset)
  1912. ;
  1913.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1914.         IMPORT_CFM_FUNCTION SetBevelButtonTextAlignment
  1915.     ENDIF
  1916.  
  1917. ;
  1918. ; pascal OSErr SetBevelButtonTextPlacement(ControlHandle inButton, ControlButtonTextPlacement inWhere)
  1919. ;
  1920.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1921.         IMPORT_CFM_FUNCTION SetBevelButtonTextPlacement
  1922.     ENDIF
  1923.  
  1924. ;  Image well routines
  1925.  
  1926. ;
  1927. ; pascal OSErr GetImageWellContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr outContent)
  1928. ;
  1929.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1930.         IMPORT_CFM_FUNCTION GetImageWellContentInfo
  1931.     ENDIF
  1932.  
  1933. ;
  1934. ; pascal OSErr SetImageWellContentInfo(ControlHandle inButton, ControlButtonContentInfoPtr inContent)
  1935. ;
  1936.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1937.         IMPORT_CFM_FUNCTION SetImageWellContentInfo
  1938.     ENDIF
  1939.  
  1940. ;
  1941. ; pascal OSErr SetImageWellTransform(ControlHandle inButton, IconTransformType inTransform)
  1942. ;
  1943.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1944.         IMPORT_CFM_FUNCTION SetImageWellTransform
  1945.     ENDIF
  1946.  
  1947. ;  Tab routines
  1948.  
  1949. ;
  1950. ; pascal OSErr GetTabContentRect(ControlHandle inTabControl, Rect *outContentRect)
  1951. ;
  1952.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1953.         IMPORT_CFM_FUNCTION GetTabContentRect
  1954.     ENDIF
  1955.  
  1956. ;
  1957. ; pascal OSErr SetTabEnabled(ControlHandle inTabControl, SInt16 inTabToHilite, Boolean inEnabled)
  1958. ;
  1959.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1960.         IMPORT_CFM_FUNCTION SetTabEnabled
  1961.     ENDIF
  1962.  
  1963. ;  Disclosure triangles
  1964.  
  1965. ;
  1966. ; pascal OSErr SetDisclosureTriangleLastValue(ControlHandle inTabControl, SInt16 inValue)
  1967. ;
  1968.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1969.         IMPORT_CFM_FUNCTION SetDisclosureTriangleLastValue
  1970.     ENDIF
  1971.  
  1972. ; ——————————————————————————————————————————————————————————————————————————————————————
  1973. ;     • Control Hierarchy (Appearance 1.0 and later only)                                    
  1974. ; ——————————————————————————————————————————————————————————————————————————————————————
  1975. ;
  1976. ; pascal SInt32 SendControlMessage(ControlHandle inControl, SInt16 inMessage, SInt32 inParam)
  1977. ;
  1978.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1979.         Macro
  1980.         _SendControlMessage
  1981.             move.w              #$FFFE,D0
  1982.             dc.w                $AA73
  1983.         EndM
  1984.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1985.         IMPORT_CFM_FUNCTION SendControlMessage
  1986.     ENDIF
  1987.  
  1988. ;
  1989. ; pascal OSErr DumpControlHierarchy(WindowPtr inWindow, const FSSpec *inDumpFile)
  1990. ;
  1991.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1992.         Macro
  1993.         _DumpControlHierarchy
  1994.             move.w              #$FFFF,D0
  1995.             dc.w                $AA73
  1996.         EndM
  1997.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1998.         IMPORT_CFM_FUNCTION DumpControlHierarchy
  1999.     ENDIF
  2000.  
  2001. ;
  2002. ; pascal OSErr CreateRootControl(WindowPtr inWindow, ControlHandle *outControl)
  2003. ;
  2004.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2005.         Macro
  2006.         _CreateRootControl
  2007.             move.w              #$0001,D0
  2008.             dc.w                $AA73
  2009.         EndM
  2010.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2011.         IMPORT_CFM_FUNCTION CreateRootControl
  2012.     ENDIF
  2013.  
  2014. ;
  2015. ; pascal OSErr GetRootControl(WindowPtr inWindow, ControlHandle *outControl)
  2016. ;
  2017.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2018.         Macro
  2019.         _GetRootControl
  2020.             move.w              #$0002,D0
  2021.             dc.w                $AA73
  2022.         EndM
  2023.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2024.         IMPORT_CFM_FUNCTION GetRootControl
  2025.     ENDIF
  2026.  
  2027. ;
  2028. ; pascal OSErr EmbedControl(ControlHandle inControl, ControlHandle inContainer)
  2029. ;
  2030.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2031.         Macro
  2032.         _EmbedControl
  2033.             move.w              #$0003,D0
  2034.             dc.w                $AA73
  2035.         EndM
  2036.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2037.         IMPORT_CFM_FUNCTION EmbedControl
  2038.     ENDIF
  2039.  
  2040. ;
  2041. ; pascal OSErr AutoEmbedControl(ControlHandle inControl, WindowPtr inWindow)
  2042. ;
  2043.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2044.         Macro
  2045.         _AutoEmbedControl
  2046.             move.w              #$0004,D0
  2047.             dc.w                $AA73
  2048.         EndM
  2049.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2050.         IMPORT_CFM_FUNCTION AutoEmbedControl
  2051.     ENDIF
  2052.  
  2053. ;
  2054. ; pascal OSErr GetSuperControl(ControlHandle inControl, ControlHandle *outParent)
  2055. ;
  2056.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2057.         Macro
  2058.         _GetSuperControl
  2059.             move.w              #$0015,D0
  2060.             dc.w                $AA73
  2061.         EndM
  2062.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2063.         IMPORT_CFM_FUNCTION GetSuperControl
  2064.     ENDIF
  2065.  
  2066. ;
  2067. ; pascal OSErr CountSubControls(ControlHandle inControl, UInt16 *outNumChildren)
  2068. ;
  2069.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2070.         Macro
  2071.         _CountSubControls
  2072.             move.w              #$0016,D0
  2073.             dc.w                $AA73
  2074.         EndM
  2075.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2076.         IMPORT_CFM_FUNCTION CountSubControls
  2077.     ENDIF
  2078.  
  2079. ;
  2080. ; pascal OSErr GetIndexedSubControl(ControlHandle inControl, UInt16 inIndex, ControlHandle *outSubControl)
  2081. ;
  2082.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2083.         Macro
  2084.         _GetIndexedSubControl
  2085.             move.w              #$0017,D0
  2086.             dc.w                $AA73
  2087.         EndM
  2088.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2089.         IMPORT_CFM_FUNCTION GetIndexedSubControl
  2090.     ENDIF
  2091.  
  2092. ;
  2093. ; pascal OSErr SetControlSupervisor(ControlHandle inControl, ControlHandle inBoss)
  2094. ;
  2095.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2096.         Macro
  2097.         _SetControlSupervisor
  2098.             move.w              #$001A,D0
  2099.             dc.w                $AA73
  2100.         EndM
  2101.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2102.         IMPORT_CFM_FUNCTION SetControlSupervisor
  2103.     ENDIF
  2104.  
  2105.  
  2106.  
  2107. ; ——————————————————————————————————————————————————————————————————————————————————————
  2108. ;     • Keyboard Focus (available only with Appearance 1.0 and later)                        
  2109. ; ——————————————————————————————————————————————————————————————————————————————————————
  2110. ;
  2111. ; pascal OSErr GetKeyboardFocus(WindowPtr inWindow, ControlHandle *outControl)
  2112. ;
  2113.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2114.         Macro
  2115.         _GetKeyboardFocus
  2116.             move.w              #$000D,D0
  2117.             dc.w                $AA73
  2118.         EndM
  2119.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2120.         IMPORT_CFM_FUNCTION GetKeyboardFocus
  2121.     ENDIF
  2122.  
  2123. ;
  2124. ; pascal OSErr SetKeyboardFocus(WindowPtr inWindow, ControlHandle inControl, ControlFocusPart inPart)
  2125. ;
  2126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2127.         Macro
  2128.         _SetKeyboardFocus
  2129.             move.w              #$000E,D0
  2130.             dc.w                $AA73
  2131.         EndM
  2132.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2133.         IMPORT_CFM_FUNCTION SetKeyboardFocus
  2134.     ENDIF
  2135.  
  2136. ;
  2137. ; pascal OSErr AdvanceKeyboardFocus(WindowPtr inWindow)
  2138. ;
  2139.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2140.         Macro
  2141.         _AdvanceKeyboardFocus
  2142.             move.w              #$000F,D0
  2143.             dc.w                $AA73
  2144.         EndM
  2145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2146.         IMPORT_CFM_FUNCTION AdvanceKeyboardFocus
  2147.     ENDIF
  2148.  
  2149. ;
  2150. ; pascal OSErr ReverseKeyboardFocus(WindowPtr inWindow)
  2151. ;
  2152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2153.         Macro
  2154.         _ReverseKeyboardFocus
  2155.             move.w              #$0010,D0
  2156.             dc.w                $AA73
  2157.         EndM
  2158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2159.         IMPORT_CFM_FUNCTION ReverseKeyboardFocus
  2160.     ENDIF
  2161.  
  2162. ;
  2163. ; pascal OSErr ClearKeyboardFocus(WindowPtr inWindow)
  2164. ;
  2165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2166.         Macro
  2167.         _ClearKeyboardFocus
  2168.             move.w              #$0019,D0
  2169.             dc.w                $AA73
  2170.         EndM
  2171.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2172.         IMPORT_CFM_FUNCTION ClearKeyboardFocus
  2173.     ENDIF
  2174.  
  2175.  
  2176.  
  2177. ; ——————————————————————————————————————————————————————————————————————————————————————
  2178. ;     • Control Data (available only with Appearance 1.0 and later)                        
  2179. ; ——————————————————————————————————————————————————————————————————————————————————————
  2180.  
  2181. ;
  2182. ; pascal OSErr GetControlFeatures(ControlHandle inControl, UInt32 *outFeatures)
  2183. ;
  2184.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2185.         Macro
  2186.         _GetControlFeatures
  2187.             move.w              #$0011,D0
  2188.             dc.w                $AA73
  2189.         EndM
  2190.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2191.         IMPORT_CFM_FUNCTION GetControlFeatures
  2192.     ENDIF
  2193.  
  2194. ;
  2195. ; pascal OSErr SetControlData(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size inSize, Ptr inData)
  2196. ;
  2197.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2198.         Macro
  2199.         _SetControlData
  2200.             move.w              #$0012,D0
  2201.             dc.w                $AA73
  2202.         EndM
  2203.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2204.         IMPORT_CFM_FUNCTION SetControlData
  2205.     ENDIF
  2206.  
  2207. ;
  2208. ; pascal OSErr GetControlData(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size inBufferSize, Ptr inBuffer, Size *outActualSize)
  2209. ;
  2210.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2211.         Macro
  2212.         _GetControlData
  2213.             move.w              #$0013,D0
  2214.             dc.w                $AA73
  2215.         EndM
  2216.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2217.         IMPORT_CFM_FUNCTION GetControlData
  2218.     ENDIF
  2219.  
  2220. ;
  2221. ; pascal OSErr GetControlDataSize(ControlHandle inControl, ControlPartCode inPart, ResType inTagName, Size *outMaxSize)
  2222. ;
  2223.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  2224.         Macro
  2225.         _GetControlDataSize
  2226.             move.w              #$0014,D0
  2227.             dc.w                $AA73
  2228.         EndM
  2229.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2230.         IMPORT_CFM_FUNCTION GetControlDataSize
  2231.     ENDIF
  2232.  
  2233.  
  2234.  
  2235.  
  2236. ; ——————————————————————————————————————————————————————————————————————————————————————
  2237. ;     • ‘CDEF’ messages                                                                    
  2238. ; ——————————————————————————————————————————————————————————————————————————————————————
  2239. ; typedef SInt16                         ControlDefProcMessage
  2240.  
  2241.  
  2242. drawCntl                        EQU        0
  2243. testCntl                        EQU        1
  2244. calcCRgns                        EQU        2
  2245. initCntl                        EQU        3
  2246. dispCntl                        EQU        4
  2247. posCntl                            EQU        5
  2248. thumbCntl                        EQU        6
  2249. dragCntl                        EQU        7
  2250. autoTrack                        EQU        8
  2251. calcCntlRgn                        EQU        10
  2252. calcThumbRgn                    EQU        11
  2253. drawThumbOutline                EQU        12
  2254. ; ——————————————————————————————————————————————————————————————————————————————————————
  2255. ;     • ‘CDEF’ entrypoint                                                                    
  2256. ; ——————————————————————————————————————————————————————————————————————————————————————
  2257. ; ——————————————————————————————————————————————————————————————————————————————————————
  2258. ;     • Constants for drawCntl message (passed in param)                                    
  2259. ; ——————————————————————————————————————————————————————————————————————————————————————
  2260.  
  2261. kDrawControlEntireControl        EQU        0
  2262. kDrawControlIndicatorOnly        EQU        129
  2263. ; ——————————————————————————————————————————————————————————————————————————————————————
  2264. ;     • Constants for dragCntl message (passed in param)                                    
  2265. ; ——————————————————————————————————————————————————————————————————————————————————————
  2266.  
  2267. kDragControlEntireControl        EQU        0
  2268. kDragControlIndicator            EQU        1
  2269. ; ——————————————————————————————————————————————————————————————————————————————————————
  2270. ;     • Drag Constraint Structure for thumbCntl message (passed in param)                    
  2271. ; ——————————————————————————————————————————————————————————————————————————————————————
  2272. IndicatorDragConstraint    RECORD 0
  2273. limitRect                 ds        Rect            ; offset: $0 (0)
  2274. slopRect                 ds        Rect            ; offset: $8 (8)
  2275. axis                     ds.w    1                ; offset: $10 (16)
  2276. sizeof                     EQU *                    ; size:   $12 (18)
  2277.                         ENDR
  2278. ; typedef struct IndicatorDragConstraint * IndicatorDragConstraintPtr
  2279.  
  2280. ; typedef IndicatorDragConstraintPtr *    IndicatorDragConstraintHandle
  2281.  
  2282.     IF ¬ TARGET_OS_MAC THEN
  2283. ; ——————————————————————————————————————————————————————————————————————————————————————
  2284. ;     • QuickTime 3.0 Win32/unix notification    mechanism                                    
  2285. ; ——————————————————————————————————————————————————————————————————————————————————————
  2286. ;  Proc used to notify window that something happened to the control
  2287.  
  2288. ;   Proc used to prefilter events before handled by control.  A client of a control calls
  2289. ;   CTRLSetPreFilterProc() to have the control call this proc before handling the event.
  2290. ;   If the proc returns TRUE, the control can go ahead and handle the event.
  2291.  
  2292.  
  2293. ;
  2294. ; extern long GetControlComponentInstance(ControlHandle theControl)
  2295. ;
  2296.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2297.         IMPORT_CFM_FUNCTION GetControlComponentInstance
  2298.     ENDIF
  2299.  
  2300. ;
  2301. ; extern ControlHandle GetControlHandleFromCookie(long cookie)
  2302. ;
  2303.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2304.         IMPORT_CFM_FUNCTION GetControlHandleFromCookie
  2305.     ENDIF
  2306.  
  2307. ;
  2308. ; extern void SetControlDefProc(short resID, ControlDefProcPtr proc)
  2309. ;
  2310.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  2311.         IMPORT_CFM_FUNCTION SetControlDefProc
  2312.     ENDIF
  2313.  
  2314.     ENDIF
  2315.     IF OLDROUTINENAMES THEN
  2316. ; ——————————————————————————————————————————————————————————————————————————————————————
  2317. ;     • OLDROUTINENAMES                                                                    
  2318. ; ——————————————————————————————————————————————————————————————————————————————————————
  2319. ;  Variants applicable to all controls (at least ones with text)
  2320.  
  2321. useWFont                        EQU        $08
  2322.  
  2323. inLabel                            EQU        1
  2324. inMenu                            EQU        2
  2325. inTriangle                        EQU        4
  2326. inButton                        EQU        10
  2327. inCheckBox                        EQU        11
  2328. inUpButton                        EQU        20
  2329. inDownButton                    EQU        21
  2330. inPageUp                        EQU        22
  2331. inPageDown                        EQU        23
  2332. inThumb                            EQU        129
  2333.  
  2334. kNoHiliteControlPart            EQU        0
  2335. kInLabelControlPart                EQU        1
  2336. kInMenuControlPart                EQU        2
  2337. kInTriangleControlPart            EQU        4
  2338. kInButtonControlPart            EQU        10
  2339. kInCheckBoxControlPart            EQU        11
  2340. kInUpButtonControlPart            EQU        20
  2341. kInDownButtonControlPart        EQU        21
  2342. kInPageUpControlPart            EQU        22
  2343. kInPageDownControlPart            EQU        23
  2344. kInIndicatorControlPart            EQU        129
  2345. kReservedControlPart            EQU        254
  2346. kControlInactiveControlPart        EQU        255
  2347.     ENDIF    ; OLDROUTINENAMES
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.     ENDIF ; __CONTROLS__ 
  2354.  
  2355.